UNPKG

abap-adt-api

Version:

Interface to Abap Developer Tools webservice

62 lines 3.12 kB
import { AdtHTTP, HttpClientResponse, RequestOptions } from "./AdtHTTP"; import { AxiosResponse } from "axios"; import * as t from "io-ts"; export declare enum SAPRC { Success = "S", Info = "I", Warning = "W", Error = "E", CriticalError = "A", Exception = "X" } export interface ExceptionProperties { conflictText: string; ideUser: string; "com.sap.adt.communicationFramework.subType": string; "T100KEY-ID": string; "T100KEY-NO": string; } export declare class AdtErrorException extends Error { readonly err: number; readonly properties: ExceptionProperties | Record<string, string>; readonly type: string; readonly message: string; readonly parent?: Error | undefined; readonly namespace?: string | undefined; readonly localizedMessage?: string | undefined; readonly response?: HttpClientResponse | undefined; get typeID(): symbol; static create(resp: HttpClientResponse, properties: ExceptionProperties | Record<string, string>): AdtErrorException; static create(err: number, properties: ExceptionProperties | Record<string, string>, type: string, message: string, parent?: Error, namespace?: string, localizedMessage?: string, response?: HttpClientResponse): AdtErrorException; constructor(err: number, properties: ExceptionProperties | Record<string, string>, type: string, message: string, parent?: Error | undefined, namespace?: string | undefined, localizedMessage?: string | undefined, response?: HttpClientResponse | undefined); } declare class AdtCsrfException extends Error { readonly message: string; readonly parent?: Error | undefined; get typeID(): symbol; constructor(message: string, parent?: Error | undefined); } declare class AdtHttpException extends Error { readonly parent: Error; get typeID(): symbol; get code(): any; get message(): string; get name(): string; constructor(parent: Error); } export type AdtException = AdtErrorException | AdtCsrfException | AdtHttpException; export declare function isAdtError(e: unknown): e is AdtErrorException; export declare function isCsrfError(e: unknown): e is AdtCsrfException; export declare function isHttpError(e: unknown): e is AdtHttpException; export declare function isAdtException(e: unknown): e is AdtException; export declare const isLoginError: (adtErr: AdtException) => boolean; export declare const fromResponse: (data: string, response: HttpClientResponse | AxiosResponse) => AdtErrorException | AdtCsrfException; export declare const fromError: (error: unknown) => AdtException; export declare function fromException(errOrResp: unknown, config?: RequestOptions): AdtException; export declare function adtException(message: string, number?: number): AdtErrorException; export declare function ValidateObjectUrl(url: string): void; export declare function ValidateStateful(h: AdtHTTP): void; export declare const validateParseResult: <T>(parseResult: t.Validation<T>) => T; export declare const isErrorMessageType: (x: string | SAPRC | undefined) => boolean; export {}; //# sourceMappingURL=AdtException.d.ts.map