Skip to content

Add errorCode to failure type InternalServerError#16186

Merged
kfaraz merged 1 commit intoapache:masterfrom
kfaraz:fix_exception_error_code
Mar 23, 2024
Merged

Add errorCode to failure type InternalServerError#16186
kfaraz merged 1 commit intoapache:masterfrom
kfaraz:fix_exception_error_code

Conversation

@kfaraz
Copy link
Copy Markdown
Contributor

@kfaraz kfaraz commented Mar 22, 2024

Looking at other failure types such as InvalidInput, InvalidSqlInput, etc. it makes sense to have the error code be fixed for a certain of failure.

The only two usages of the method InternalServerError.exception() were actually passing a whole long message in the error code. This would result in the errorCode field being populated with the error message and the errorMsg field itself taking the value of the first message argument.

Changes

  • Use error code internalServerError for failures of this type
  • Remove the error code argument from InternalServerError.exception() methods thus fixing the above mentioned bug in the callers.

@kfaraz kfaraz merged commit 323d67a into apache:master Mar 23, 2024
@kfaraz kfaraz deleted the fix_exception_error_code branch March 23, 2024 22:54
@kfaraz
Copy link
Copy Markdown
Contributor Author

kfaraz commented Mar 23, 2024

Thanks for the review, @LakshSingla !

@adarshsanjeev adarshsanjeev added this to the 30.0.0 milestone May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants