Theia API Documentation v1.76.0
    Preparing search index...

    Writes RestResults and error responses of the external API to HTTP responses.

    All responses of the external API go through this service: the results of typed routes, request body validation failures, the token verification, and the fallback error handling. Rebind it to change the wire format of the external API consistently.

    interface ExternalApiResponseWriter {
        write(result: RestResult, response: Response): void;
        writeError(
            status: number,
            code: string,
            response: Response,
            details?: string[],
        ): void;
    }

    Implemented by

    Index

    Methods

    • Writes an error response with the given status, stable machine-readable error code, and optional human-readable details, e.g. body validation errors. Unlike the code, the details make no stability promise.

      Parameters

      • status: number
      • code: string
      • response: Response
      • Optionaldetails: string[]

      Returns void