global error thrown
Closed this issue · 1 comments
DesTincT commented
JoCat commented
Since the query returns a non-zero error code, it is treated as an error in any case.
You can intercept the error in the request with try/catch and, in case of an error with an order not found, use resolve
for example:
try {
await acquiring.get(undefined, orderNumber);
} catch (error) {
if (error.sberErrorCode == 6 /* or === '6' */) {
return 'Order not found';
}
console.error('Error is caught:', error);
}