Skip to content

Commit

Permalink
Changed GError for the same reason as GObject
Browse files Browse the repository at this point in the history
  • Loading branch information
noha committed Jul 15, 2020
1 parent fd68ea9 commit 65a03cf
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Geometry-Tests/GAngleTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ GAngleTest >> testMultiplication [
self assert: angle * 2 equals: 180 degrees.
self assert: 2 * angle equals: 180 degrees.
self assert: angle * 1 equals: 90 degrees.
self should: [ angle * 10 degrees ] raise: GError description: 'It should not be possible to multiple two angles'
self should: [ angle * 10 degrees ] raise: GeometryError description: 'It should not be possible to multiple two angles'
]

{ #category : #tests }
Expand Down
2 changes: 1 addition & 1 deletion src/Geometry-Tests/GPointTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,5 @@ GPointTest >> testTranslateBy [
{ #category : #tests }
GPointTest >> testWithCollection [
self assert: (GPoint withCollection: #(1 2)) equals: 1 , 2.
self should: [ GPoint withCollection: #() ] raise: GError
self should: [ GPoint withCollection: #() ] raise: GeometryError
]
2 changes: 1 addition & 1 deletion src/Geometry-Tests/GPolygonTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ GPolygonTest >> testScaleBy [
polygon scaleBy: 1 / 2.
self assert: polygon vertices equals: {(5 , 2) . (-2 , 5) . (-5 , -5)}.

self should: [ polygon scaleBy: 0 ] raise: GError
self should: [ polygon scaleBy: 0 ] raise: GeometryError
]

{ #category : #tests }
Expand Down
4 changes: 2 additions & 2 deletions src/Geometry-Tests/GRectangleTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ GRectangleTest >> testIntersectionsWithRay [

{ #category : #tests }
GRectangleTest >> testVertices [
self should: [ GRectangle vertices: {(1 , 1) . (2 , 2) . (3 , 5)} ] raise: GError.
self should: [ GRectangle vertices: {(0 , 0) . (2 , 0) . (2 , -2) . (-1 , -2)} ] raise: GError
self should: [ GRectangle vertices: {(1 , 1) . (2 , 2) . (3 , 5)} ] raise: GeometryError.
self should: [ GRectangle vertices: {(0 , 0) . (2 , 0) . (2 , -2) . (-1 , -2)} ] raise: GeometryError
]

{ #category : #tests }
Expand Down
4 changes: 2 additions & 2 deletions src/Geometry-Tests/GTestCase.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ GTestCase >> testEquals [

{ #category : #tests }
GTestCase >> testErrorsArePersonnalized [
self should: [ self newInstance error ] raise: GError.
self should: [ self newInstance error: 'Error' ] raise: GError
self should: [ self newInstance error ] raise: GeometryError.
self should: [ self newInstance error: 'Error' ] raise: GeometryError
]
4 changes: 2 additions & 2 deletions src/Geometry/GLine.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ GLine >> = line [
(self isParallelTo: line) ifFalse: [ ^ false ].

^ [ (self yFor: 1) =~ (line yFor: 1) ]
on: GError
on: GeometryError
do: [ "This can happen if b = 0" (self xFor: 1) =~ (line xFor: 1) ]
]

Expand Down Expand Up @@ -117,7 +117,7 @@ GLine >> distanceTo: aGPoint [
{ #category : #comparing }
GLine >> hash [
^ ([ self yFor: 1 ]
on: GError
on: GeometryError
do: [ "This can happen if b = 0" self xFor: 1 ]) hash
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Description
I am a common exception for the Geometry project
"
Class {
#name : #GError,
#name : #GeometryError,
#superclass : #Error,
#category : #'Geometry-Exceptions'
}
4 changes: 2 additions & 2 deletions src/Geometry/GeometryObject.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ Class {

{ #category : #'error handling' }
GeometryObject class >> error [
GError signal
GeometryError signal
]

{ #category : #'error handling' }
GeometryObject class >> error: aString [
GError signal: aString
GeometryError signal: aString
]

{ #category : #'error handling' }
Expand Down

0 comments on commit 65a03cf

Please sign in to comment.