Skip to content

Commit a0d3917

Browse files
rahearnkodiakhq[bot]
andauthoredMar 14, 2022
fix: replace instanceof check (#6284)
error instanceof EditorialWorkflowError was returning false for a custom backend that inherited from GitGatewayBackend Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 964d697 commit a0d3917

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎packages/netlify-cms-core/src/backend.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import {
55
localForage,
66
Cursor,
77
CURSOR_COMPATIBILITY_SYMBOL,
8-
EditorialWorkflowError,
98
getPathDepth,
109
blobToFileObj,
1110
asyncLock,
11+
EDITORIAL_WORKFLOW_ERROR,
1212
} from 'netlify-cms-lib-util';
1313
import { basename, join, extname, dirname } from 'path';
1414
import { stringTemplate } from 'netlify-cms-lib-widgets';
@@ -417,7 +417,7 @@ export class Backend {
417417
(await this.implementation
418418
.unpublishedEntry({ collection: collection.get('name'), slug })
419419
.catch(error => {
420-
if (error instanceof EditorialWorkflowError && error.notUnderEditorialWorkflow) {
420+
if (error.name === EDITORIAL_WORKFLOW_ERROR && error.notUnderEditorialWorkflow) {
421421
return Promise.resolve(false);
422422
}
423423
return Promise.reject(error);

0 commit comments

Comments
 (0)
Please sign in to comment.