Flarum (v2.0.0-beta.6)
    Preparing search index...

    Interface ApiQueryRequestOptions<ResponseType>

    interface ApiQueryRequestOptions<ResponseType> {
        errorHandler?: (
            error: RequestError,
        ) => false | void | Promise<false | void>;
        modifyText?: (responseText: string) => string;
    }

    Type Parameters

    • ResponseType

    Hierarchy

    Index

    Properties

    errorHandler?: (error: RequestError) => false | void | Promise<false | void>

    Custom error handler for failed requests. Overrides the default error handler.

    Return false (sync or promise) to fall back to the default error handler. Useful for handling specific errors without displaying error alerts to the user. To always show alerts, catch the error rejected by app.request instead.

    Type Declaration

      • (error: RequestError): false | void | Promise<false | void>
      • Parameters

        Returns false | void | Promise<false | void>

        false (sync or promise) to fall back to the default error handler.

    modifyText?: (responseText: string) => string

    Manipulate the response text before it is parsed into JSON.

    This overrides any extract method provided.