mobilizon.chapril.org-mobil.../js/src/types/apollo.ts

11 lines
319 B
TypeScript
Raw Normal View History

import { ServerParseError } from "@apollo/client/link/http";
import { ServerError } from "@apollo/client/link/utils";
2019-08-12 16:04:16 +02:00
function isServerError(
err: Error | ServerError | ServerParseError | undefined
): err is ServerError {
2019-08-12 16:04:16 +02:00
return !!err && (err as ServerError).statusCode !== undefined;
}
export { isServerError };