feat(core): add vue flow error class

Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
braks
2023-02-05 23:55:27 +01:00
committed by Braks
parent 1448543993
commit dc60e112a1
6 changed files with 12 additions and 3 deletions
+6
View File
@@ -1,5 +1,11 @@
const productionEnvs = ['production', 'prod']
export class VueFlowError extends Error {
constructor(message: string, scope?: string) {
super(`[Vue Flow]: ${scope ? `${scope} - ` : ''}${message}`)
}
}
export const warn = (message: string, ...args: any[]) => {
if (!productionEnvs.includes(__ENV__ || '')) {
console.warn(`[Vue Flow]: ${message}`, ...args)