dt-app
Version:
The Dynatrace App Toolkit is a tool you can use from your command line to create, develop, and deploy apps on your Dynatrace environment.
47 lines (46 loc) • 1.68 kB
TypeScript
/**
* All error codes that are listed here --> https://ec-repo.lab.dynatrace.org:8443/error-codes
*/
export declare enum DynatraceErrorCode {
GENERIC_CLI_ERROR = "DEC:D9",
CONNECTION_ERROR = "DEC:DA"
}
/**
* Node.js exit codes to get consistent telemetry reporting.
* Loosely based on: https://nodejs.org/api/process.html#exit-codes
*/
export declare enum ErrorCause {
POSIX_SIGNAL_BASE = 128,
UNCAUGHT = 256,
INTERNAL = 257,
USER = 258,
AUTH = 259,
TIMEOUT = 260,
COMPILATION = 261,
NETWORKING = 263,
VALIDATION = 264,
BUILD = 265,
APP_GATEWAY_COMMUNICATION = 266
}
/** Creates an error for the credentials request. */
export declare function getCredentialsError(message: string): Error;
/**
* Function to clean the stack trace of an error from privacy related information.
* @param rawStacktrace The raw stacktrace provided by js error implementation.
* @returns Sanitized stacktrace
*/
export declare function sanitizeStacktrace(rawStacktrace: string | undefined): string;
/**
* Function to clean the error message of any privacy related information.
* @param rawErrorMessage The raw error message to clean.
* @returns Sanitized error message
*/
export declare function sanitizeErrorMessage(rawErrorMessage: string | undefined): string;
/** Casts unknown error to a error of type Error */
export declare function toError(e: unknown): Error;
/**
* Throws an error with the message prefixed by the green error code.
* @param error The error object to throw.
* @param errorCode The error code to prefix.
*/
export declare function throwWithDynatraceErrorCode(error: Error, errorCode: DynatraceErrorCode): never;