If the server returns 401, for example, it is not in the same format as Hrana errors. Therefore, first attempt to parse a server error and only then parse Hrana errors.
For example, the following error:
Error: failed to connect to database. err: failed to execute SQL: SELECT 1;
now becomes:
Error: failed to connect to database. err: failed to execute SQL: SELECT 1;
error code 401: Unauthorized: TheAuthorizationHTTP header is required but was not specified
If the server returns 401, for example, it is not in the same format as Hrana errors. Therefore, first attempt to parse a server error and only then parse Hrana errors.
For example, the following error:
Error: failed to connect to database. err: failed to execute SQL: SELECT 1;
now becomes:
Error: failed to connect to database. err: failed to execute SQL: SELECT 1; error code 401: Unauthorized:
The
AuthorizationHTTP header is required but was not specified