Shun Miyazawa пре 3 година
родитељ
комит
bf7fc9920f
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      packages/app/src/interfaces/errors/v3-error.ts

+ 5 - 0
packages/app/src/interfaces/errors/v3-error.ts

@@ -1,3 +1,8 @@
 import { ErrorV3 } from '@growi/core';
 
 export type IErrorV3 = ErrorV3
+
+// type guard
+export const isErrorV3 = (args: any): args is IErrorV3 => {
+  return args.message != null && args.code != null;
+};