Ability to register a error handlers for services #19117
Labels
Team/CompilerFE
All issues related to Language implementation and Compiler, this exclude run times.
Type/Improvement
Description:
I propose there has to be a way to register (global and/or per service) error-handlers for ballerina 'service' construct.
Reason: I need to be able to control the behavior (and content) of how errors are transmitted back to client. For example: if I'm running my ballerina service in a local/dev environment I should be able send a descriptive message about the error that occurred while if I'm running in production I probably don't want to reveal too much information to the client.
Now I can do the same thing by checking for each error condition with-in the 'resource'. But reality of that is, amount of 'boiler-plate' code written becomes higher than code written for 'business-logic'.
As per my understanding, programmer can't customize the default behavior.
Affected Versions:
v 1.0.0
OS, DB, other environment details and versions:
Mac, Jdk 1.8
@sameerajayasoma
The text was updated successfully, but these errors were encountered: