2021-05-12 18:10:07 +02:00
|
|
|
import { ServerParseError } from "@apollo/client/link/http";
|
|
|
|
import { ServerError } from "@apollo/client/link/utils";
|
2019-08-12 16:04:16 +02:00
|
|
|
|
2020-02-18 08:57:00 +01: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 };
|