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(url-validation): use error response from server #1308

Merged
merged 4 commits into from
Mar 16, 2021

Conversation

orbitalsqwib
Copy link
Contributor

Problem

Server errors are currently hard-coded to display "Server Error", instead of the actual error response returned from the server.

Closes #1175

Solution

Fixed the error handling code to display the actual error message from the response.

Currently, the server createURL error handler defaults to printing the full error message in the
logger and outputs 'Server Error' as the error message

-replaced 'Server Error' with actual error
message from server
-changed blacklist url error message to match circular redirects error message
(keep the 'error' in 'Validation error' lowercase)

fix #1175
Currently, tests expect a string with no type

-remove LongURLError type to match expected results

fix #1175
@orbitalsqwib orbitalsqwib changed the title Fix/url validation fix(url-validation): use error response from server Mar 16, 2021
Copy link
Contributor

@LoneRifle LoneRifle left a comment

Choose a reason for hiding this comment

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

As discussed - this might disclose issues with the service that we might not want to disclose. We might be able to handle the validation error more specifically; look at code blocks above to figure out the handling

@LoneRifle LoneRifle merged commit 1311db6 into develop Mar 16, 2021
@LoneRifle LoneRifle deleted the fix/url-validation branch March 16, 2021 09:37
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.

Show appropriate error message when user try to shorten a go.gov.sg link
2 participants