Skip to content

Commit 0f69306

Browse files
committed
better error message
1 parent 8edb83d commit 0f69306

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/compas/geometry/surfaces/nurbs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def __from_data__(cls, data):
182182

183183
def __new__(cls, *args, **kwargs):
184184
if cls is NurbsSurface:
185-
raise TypeError("Instantiating the base NURBS Surface class directly is not allowed.")
185+
raise TypeError("Making an instance of `NurbsSurface` using `NurbsSurface()` is not allowed. Please use one of the factory methods instead (`NurbsSurface.from_...`)")
186186
return object.__new__(cls)
187187

188188
def __repr__(self):

src/compas/geometry/surfaces/surface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Surface(Geometry):
4646

4747
def __new__(cls, *args, **kwargs):
4848
if cls is Surface:
49-
raise TypeError("Instantiating the base Surface class directly is not allowed.")
49+
raise TypeError("Making an instance of `Surface` using `Surface()` is not allowed. Please use one of the factory methods instead (`Surface.from_...`)")
5050
return object.__new__(cls)
5151

5252
def __init__(self, frame=None, name=None):

0 commit comments

Comments
 (0)