-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve error handling on missing controller & serializer files (…
…#118) We now have the following messages when a file is missing ``` Error: Could not resolve model by name 'user' Error: Could not resolve controller by name 'users' Error: Could not resolve serializer by name 'users' ``` Fixes #104
- Loading branch information
1 parent
1dd3ab6
commit a7f1910
Showing
4 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class ControllerMissingError extends Error { | ||
constructor(resource) { | ||
return super(`Could not resolve controller by name '${resource}'`); | ||
} | ||
} | ||
|
||
export default ControllerMissingError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export ControllerMissingError from './controller-missing'; | ||
export SerializerMissingError from './serializer-missing'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class SerializerMissingError extends Error { | ||
constructor(resource) { | ||
return super(`Could not resolve serializer by name '${resource}'`); | ||
} | ||
} | ||
|
||
export default SerializerMissingError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters