Function isErrorStatus

  • A type guard that determines if the status code is an error.

    Parameters

    • status: number

      The status to assert against.

    Returns status is ErrorStatus

    Whether or not the provided status is an error status code.

    import { isErrorStatus } from "@std/http/status";
    import { assert } from "@std/assert";

    assert(isErrorStatus(502));