main
js 21 lines 602 Bytes
Raw
1 /**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @flow
8 */
9
10 export class PermissionNotGrantedError extends Error {
11 constructor() {
12 super("User didn't grant the required permission to perform an action");
13
14 // Maintains proper stack trace for where our error was thrown (only available on V8)
15 if (Error.captureStackTrace) {
16 Error.captureStackTrace(this, PermissionNotGrantedError);
17 }
18
19 this.name = 'PermissionNotGrantedError';
20 }
21 }