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
Currently the relay will accept error code in acceptedErrorStatusesResponsePerRequestPathMap[MirrorNodeClient.CONTRACT_CALL_ENDPOINT] and not throw an error.
This may be problematic as it would return a 0x value instead of throwing to clients.
Solution
Verify that 0x is not an appropriate value to return on any of these codes.
Assuming so reduce the array of codes to an empty array []
In this way all error from the mirror node would result in errors to the user.
Also remove the 0x return in callMirrorNode() if not applicable
@Nana-EC, taking a further look at this, my take is that the mirrorNode Client is the one that is returning null whenever it gets any acceptedErrorCodes from the mirror node, and is up to the implementation of the methods using the mirrorNode client what to do with the null value.
In some, is part of the logic, and in some they do return an exception, and in some as you noted, it might end-up returning 0x.
My suggestion is to always return the corresponding error from the mirrorNodeClient and instead of the methods using the mirror node handling the null as they need, they handle the exception, but in some cases they will not return that exception to the user since is part of a path flow of the logic, to verify for the existence or the absentee of something. so for example if we return a 404 exception instead of null in those cases, the call to the mirror node will have to be wrapped in a try catch block and depending on wether it goes to the catch, do one or the other actions...
I am not sure how much we want to use try catch as part of the flow of code, thus making this comment.
Problem
Currently the relay will accept error code in
acceptedErrorStatusesResponsePerRequestPathMap[MirrorNodeClient.CONTRACT_CALL_ENDPOINT]
and not throw an error.This may be problematic as it would return a
0x
value instead of throwing to clients.Solution
Verify that
0x
is not an appropriate value to return on any of these codes.Assuming so reduce the array of codes to an empty array
[]
In this way all error from the mirror node would result in errors to the user.
Also remove the
0x
return incallMirrorNode()
if not applicableEndpoints to refactor:
Alternatives
No response
The text was updated successfully, but these errors were encountered: