Skip to content

Commit

Permalink
improved error when controller was not found
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Nov 2, 2024
1 parent 81aa242 commit ecaf4b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions repository/OpenPonk-Core/OPController.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,14 @@ OPController >> removeControllerAndDiagramElement [
{ #category : 'destruction' }
OPController >> removeControllerAndModel [

self removeDependent.
self removeDependentConrollersAndModels.
self removeControllerAndDiagramElement.
self removeModel.
self model: nil
]

{ #category : 'destruction' }
OPController >> removeDependent [
OPController >> removeDependentConrollersAndModels [
self dependentControllers
do: [ :each |
self diagramController controllers
Expand Down
9 changes: 7 additions & 2 deletions repository/OpenPonk-Core/OPControllerFactory.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@ OPControllerFactory >> initialize [

{ #category : 'api - accessing' }
OPControllerFactory >> newControllerFor: aModel [

| controller |
controller := (registrations detect: [ :each | each isForModel: aModel ]) controllerClass
new.
controller := (registrations
detect: [ :each | each isForModel: aModel ]
ifNone: [
self error:
'Unable to find controller class for model: '
, aModel asString ]) controllerClass new.
controller model: aModel.
^ controller
]
Expand Down

0 comments on commit ecaf4b1

Please sign in to comment.