interface error {
    use headers.{headers};

    // An HTTP error response.
    record error-response {
        // HTTP status code. Must be a valid status code. If not, the status code will be 500.
        status-code: u16,
        // List of GraphQL errors.
        errors: list<error>,
        // The headers to send with the response. Keys and values must be ASCII strings.
        headers: option<headers>
    }

    // An error response can be used to inject an error to the GraphQL response.
    record error {
        // Adds the given extensions to the response extensions. The first item in
        // the tuple is the extension key, and the second item is the extension value encoded in CBOR
        extensions: list<tuple<string, list<u8>>>,
        // The error message.
        message: string,
    }
}
