Skip to content
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

fix: fixing "500 internal server error" response #137

Merged
merged 1 commit into from
Sep 6, 2022

Conversation

artursudnik
Copy link
Member

This PR implements a logic that makes VpSubmissionVerifierService.verifyVpRequestSubmission return an error item instead of throwing an exception resulting in a "500 internal server error" HTTP response.

…atePresentation is not able to accept a presentation definition and throws a "string" exception
@artursudnik artursudnik self-assigned this Sep 6, 2022
@artursudnik artursudnik merged commit da9c019 into develop Sep 6, 2022
presentationDefinition,
presentation as IPresentation
);
let partialErrors;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's better to initialize the empty array and use const

Suggested change
let partialErrors;
const partialErrors = [];

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIR it forced next lines to be split into more steps as { errors: partialErrors } = pex.evaluatePresentation( is not valid then. And it would require this that is less readable I think:

const { errors } = pex.evaluatePresentation(
          presentationDefinition,
          presentation as IPresentation
        )
        
        partialErrors.push(...errors);

@artursudnik artursudnik deleted the fix/500-internal-error branch September 6, 2022 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants