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.
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.