-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added error codes to property validation errors #835
base: main
Are you sure you want to change the base?
Added error codes to property validation errors #835
Conversation
Signed-off-by: Subhajit Ghosh <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What type of exception is this one? will it be falling under base exception @ekarademir
concerto/packages/concerto-core/lib/introspect/property.js
Lines 181 to 184 in abd1c8e
if(!parent) { | |
throw new Error('Property ' + this.name + ' does not have a parent.'); | |
} | |
const modelFile = parent.getModelFile(); |
Signed-off-by: Subhajit Ghosh <[email protected]>
Usually |
Okay, Hey have added that. |
@@ -178,15 +179,15 @@ class Property extends Decorated { | |||
|
|||
const parent = this.getParent(); | |||
if(!parent) { | |||
throw new Error('Property ' + this.name + ' does not have a parent.'); | |||
throw new IllegalModelException('Property ' + this.name + ' does not have a parent.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey I have added a new param called errorType
in illeagalexception and basefilexception ,
Is this the correct way to add error codes? need some feedback @ekarademir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should follow the class name of the exception being thrown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few more bits and pieces please
@@ -14,8 +14,9 @@ declare class BaseFileException extends BaseException { | |||
* @param {string} fullMessage - the optional full message text | |||
* @param {string} [fileName] - the file name | |||
* @param {string} [component] - the component which throws this error | |||
* @param {string} errorType - The optional error code regarding the error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing this is generated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I have written that. Should it be removed or should I add @param {string} [errorType='BaseFileException'] - the error code
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you generate the types then please? npx lerna run build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I execute the command it generated a bunch of other type files like 81 files has been generated.
Should I commit all of them ? @ekarademir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I think I have resolved the problem.
Generated all the required types.
packages/concerto-core/types/lib/introspect/illegalmodelexception.d.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Subhajit Ghosh <[email protected]>
2cd1d97
to
14ea7ac
Compare
Signed-off-by: Subhajit Ghosh <[email protected]>
4b25498
to
0c19cfb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@subhajit20 it looks like it's failing linting rules, could you please update the PR?
This PR is stale because it has been open 15 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Closes #834
Author Checklist
--signoff
option of git commit.main
fromfork:branchname