I'm building an API for my project and I'd like to throw custom error to catch it in my application.
Following the documentation, I throw error with the code "unknown"
throw new functions.https
.HttpsError("unknown",
"this is my error message",
{code :'myCustomCode',
message :'my custom message'}
)
Then, I catch with the right message and details, but with a"Internal Server Error"
I'am not sure it's the best way to create a clean API with cloud function.
Do you have suggestions?