UNPKG

569 BPlain TextView Raw
1import Platform from '../Platform';
2import { CodedError } from './CodedError';
3
4/**
5 * A class for errors to be thrown when a property is accessed which is
6 * unavailable, unsupported, or not currently implemented on the running
7 * platform.
8 */
9export class UnavailabilityError extends CodedError {
10 constructor(moduleName: string, propertyName: string) {
11 super(
12 'ERR_UNAVAILABLE',
13 `The method or property ${moduleName}.${propertyName} is not available on ${Platform.OS}, are you sure you've linked all the native dependencies properly?`
14 );
15 }
16}