feat: migrate app routes and business modules
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
export const isWriteOutcomeUnknown = (error) => {
|
||||
if (!error || typeof error !== 'object') return false
|
||||
if (
|
||||
error.code === 'REQUEST_TIMEOUT' ||
|
||||
error.code === 'NETWORK_ERROR' ||
|
||||
error.code === 'RESPONSE_INVALID' ||
|
||||
error.code === 'REQUEST_CANCELLED'
|
||||
) {
|
||||
return true
|
||||
}
|
||||
if (error.code !== 'HTTP_ERROR' && error.code !== 'BUSINESS_ERROR') return false
|
||||
|
||||
const status = Number(
|
||||
error.code === 'HTTP_ERROR' ? error.httpStatus : error.businessCode
|
||||
)
|
||||
if (!Number.isInteger(status)) return true
|
||||
return !(status >= 400 && status < 500 && status !== 408)
|
||||
}
|
||||
Reference in New Issue
Block a user