Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

[Refactor] Add custom error type for failed auto alias #950

Open
Coteh opened this issue Jul 11, 2020 · 0 comments
Open

[Refactor] Add custom error type for failed auto alias #950

Coteh opened this issue Jul 11, 2020 · 0 comments

Comments

@Coteh
Copy link
Collaborator

Coteh commented Jul 11, 2020

What is frustrating you?
In CreateShortLink, if auto alias generation fails, error is thrown to API consumer. This can expose more details than necessary to API caller and could risk API being attacked by hackers.

Your solution
Add a new error type to use case layer that signifies to API caller that short link creation failed due to error generating alias, without revealing any information from the implementation of auto alias generation. Throw this new error type in use case layer when auto alias fails.

Alternatives considered
Throw error as-is from use case layer and let the GraphQL resolver create a new error type for auto alias fail.

@magicoder10 magicoder10 changed the title [Refactor] Consider adding custom error type for failed auto alias [Refactor] Add custom error type for failed auto alias Jul 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant