Skip to content

Commit 4a681a4

Browse files
committed
fix(json_copy): Warn on error and rethrow to caller. They may be able to recover
1 parent 2118e08 commit 4a681a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/lib/json_copy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const json_copy = (data, callee) => {
66
return JSON.parse(JSON.stringify(data));
77
} catch (e) {
88
//this is unlikely to be hit due to the passed in data already being loaded using JSON parsers
9-
plutils.error(`JSON provided by ${callee} is invalid and cannot be copied`);
10-
return {};
9+
plutils.warning(`JSON provided by ${callee} is invalid and cannot be copied`);
10+
throw (e);
1111
}
1212
};
1313

0 commit comments

Comments
 (0)