In #2590 we've talked about adding concrete error codes to errors thrown in public RPC methods. This would help RPC clients work better with the node/PXE by handling errors and presenting human friendly information.
I think an enum listing out all error codes would be a good idea. This would make the error codes easy to document and we'd also ensure uniqueness (e.g. so that clients don't get the same error code for two different API errors).
A dedicated AztecError class that takes a code would be thrown in APIs instead of a plain Error.
In #2590 we've talked about adding concrete error codes to errors thrown in public RPC methods. This would help RPC clients work better with the node/PXE by handling errors and presenting human friendly information.
I think an enum listing out all error codes would be a good idea. This would make the error codes easy to document and we'd also ensure uniqueness (e.g. so that clients don't get the same error code for two different API errors).
A dedicated
AztecErrorclass that takes a code would be thrown in APIs instead of a plain Error.