Readonly codeOptional Readonly detailsAdditional details to add to the error. These details will be present in the GraphQL API Response and in the resulting log when using Mosaic default settings.
Passing skipMaskTag will mark the resulting log to skip the masking of
possible sensitive values, but the skipMaskTag property itself will be removed from the
GraphQL API Response details.
import { MosaicError, skipMaskTag } from '@axinom/mosaic-service-common';
throw new MosaicError({
...CustomErrorCode.YourError,
details: { skipMaskTag },
});
Optional Readonly errorOptional Readonly logAdditional information to add to the error to be logged. This info will NOT be present in the GraphQL API Response when using Mosaic default settings.
Passing skipMaskTag will mark the resulting log to skip the masking of
possible sensitive values.
import { MosaicError, skipMaskTag } from '@axinom/mosaic-service-common';
throw new MosaicError({
...CustomErrorCode.YourError,
logInfo: { skipMaskTag },
});
Readonly messageOptional Readonly messageAn array of parameter to be used for printf-style message placeholders.
import { MosaicError, MosaicErrors } from '@axinom/mosaic-service-common';
// The MosaicErrors.AssertionFailed.message is: "The assertion check for the identifier %s failed."
throw new MosaicError({
message: MosaicErrors.AssertionFailed.message, // 'The assertion check for the identifier email failed.'
code: 'YOUR_CODE',
messageParams: ['email'],
});
Generated using TypeDoc
An error info object that represents a mapped Error to be thrown.