@nevis-security/nevis-mobile-authentication-sdk-react
Version:
React Native plugin for Nevis Mobile Authentication SDK. Supports only mobile.
46 lines (44 loc) • 3.19 kB
JavaScript
/**
* Copyright © 2023-2024 Nevis Security AG. All rights reserved.
*/
import { DeviceInformationChangeClockSkewTooBigError } from './DeviceInformationChangeClockSkewTooBigError';
import { DeviceInformationChangeDeviceProtectionError } from './DeviceInformationChangeDeviceProtectionError';
import { DeviceInformationChangeNameAlreadyExists } from './DeviceInformationChangeNameAlreadyExists';
import { DeviceInformationChangeNetworkError } from './DeviceInformationChangeNetworkError';
import { DeviceInformationChangeNoDeviceLockError } from './DeviceInformationChangeNoDeviceLockError';
import { DeviceInformationChangeNotFound } from './DeviceInformationChangeNotFound';
import { DeviceInformationChangeUnknownError } from './DeviceInformationChangeUnknownError';
import { ErrorConverter } from '../../ErrorConverter';
var DeviceInformationChangeErrorType = /*#__PURE__*/function (DeviceInformationChangeErrorType) {
DeviceInformationChangeErrorType[DeviceInformationChangeErrorType["ClockSkewTooBig"] = 0] = "ClockSkewTooBig";
DeviceInformationChangeErrorType[DeviceInformationChangeErrorType["DeviceProtectionError"] = 1] = "DeviceProtectionError";
DeviceInformationChangeErrorType[DeviceInformationChangeErrorType["NameAlreadyExists"] = 2] = "NameAlreadyExists";
DeviceInformationChangeErrorType[DeviceInformationChangeErrorType["NetworkError"] = 3] = "NetworkError";
DeviceInformationChangeErrorType[DeviceInformationChangeErrorType["NoDeviceLockError"] = 4] = "NoDeviceLockError";
DeviceInformationChangeErrorType[DeviceInformationChangeErrorType["NotFound"] = 5] = "NotFound";
DeviceInformationChangeErrorType[DeviceInformationChangeErrorType["Unknown"] = 6] = "Unknown";
return DeviceInformationChangeErrorType;
}(DeviceInformationChangeErrorType || {});
export class DeviceInformationChangeErrorConverter extends ErrorConverter {
convert() {
const subtype = DeviceInformationChangeErrorType[this.error.type];
switch (subtype) {
case DeviceInformationChangeErrorType.ClockSkewTooBig:
return new DeviceInformationChangeClockSkewTooBigError(this.error.description, this.error.cause);
case DeviceInformationChangeErrorType.DeviceProtectionError:
return new DeviceInformationChangeDeviceProtectionError(this.error.description, this.error.cause);
case DeviceInformationChangeErrorType.NameAlreadyExists:
return new DeviceInformationChangeNameAlreadyExists(this.error.description, this.error.cause);
case DeviceInformationChangeErrorType.NetworkError:
return new DeviceInformationChangeNetworkError(this.error.description, this.error.cause);
case DeviceInformationChangeErrorType.NoDeviceLockError:
return new DeviceInformationChangeNoDeviceLockError(this.error.description, this.error.cause);
case DeviceInformationChangeErrorType.NotFound:
return new DeviceInformationChangeNotFound(this.error.description, this.error.cause);
case DeviceInformationChangeErrorType.Unknown:
return new DeviceInformationChangeUnknownError(this.error.description, this.error.cause);
}
}
}
//# sourceMappingURL=DeviceInformationChangeErrorConverter.js.map
;