Unify Harbor error handling across server and client
This commit is contained in:
@@ -22,7 +22,7 @@ export function compatibleSnapshot(snapshot) {
|
||||
export function classifySyncError(error) {
|
||||
const status = Number(error?.status) || 0;
|
||||
if (error?.code === 'INCOMPATIBLE_API' || status === 404) return 'incompatible-api';
|
||||
if (error?.name === 'TypeError' || status >= 500) return 'control-unreachable';
|
||||
if (error?.code === 'CONTROL_UNREACHABLE' || error?.name === 'TypeError' || status >= 500) return 'control-unreachable';
|
||||
return 'fatal';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user