You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lets say every function (login, refreshToken. checkStatus aswell as other function in other Resource classes) all share the same error handling treatment. for simplicity lets say its
Instead of using all this boiler plate in each function I wanted to know if there is a way to wrap every function inside another one that would do the error handling like per example:
The problem here is that I get the error
"type 'Response' is not a subtype of type 'Function'"
I believe the error is that I cannot call the functions inside the @OverRide routes. I need to just pass functions like _login and not _login() per example.
So, is there a way to reduce the errorHandling boilerplate?
NoSuchMethodError: Closure call with mismatched arguments: function 'EmailVerifyEndPoint._checkCode'
Receiver: Closure: (Injector, ModularArguments) => FutureOr from Function '_checkCode@195052454':.
Tried calling: EmailVerifyEndPoint._checkCode()
Found: EmailVerifyEndPoint._checkCode(Injector, ModularArguments) => FutureOr
Unhandled exception:
type 'Response' is not a subtype of type 'Function'
The text was updated successfully, but these errors were encountered:
Inside a Resource class I have this snippet code:
Lets say every function (login, refreshToken. checkStatus aswell as other function in other Resource classes) all share the same error handling treatment. for simplicity lets say its
try {
// execute function code
} catch(e) {
return Response.internalServerError();
}
Instead of using all this boiler plate in each function I wanted to know if there is a way to wrap every function inside another one that would do the error handling like per example:
and then I would call the function like:
The problem here is that I get the error
"type 'Response' is not a subtype of type 'Function'"
I believe the error is that I cannot call the functions inside the @OverRide routes. I need to just pass functions like _login and not _login() per example.
So, is there a way to reduce the errorHandling boilerplate?
NoSuchMethodError: Closure call with mismatched arguments: function 'EmailVerifyEndPoint._checkCode'
Receiver: Closure: (Injector, ModularArguments) => FutureOr from Function '_checkCode@195052454':.
Tried calling: EmailVerifyEndPoint._checkCode()
Found: EmailVerifyEndPoint._checkCode(Injector, ModularArguments) => FutureOr
Unhandled exception:
type 'Response' is not a subtype of type 'Function'
The text was updated successfully, but these errors were encountered: