File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
components/google_drive/common Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 11import fs from "fs" ;
2- import { axios } from "@pipedream/platform" ;
2+ import {
3+ axios , ConfigurationError ,
4+ } from "@pipedream/platform" ;
35import {
46 MY_DRIVE_VALUE ,
57 LEGACY_MY_DRIVE_VALUE ,
@@ -266,9 +268,16 @@ function optionalParseAsJSON(value) {
266268}
267269
268270function parseObjectEntries ( value = { } ) {
269- const obj = typeof value === "string"
270- ? JSON . parse ( value )
271- : value ;
271+ let obj ;
272+ if ( typeof value === "string" ) {
273+ try {
274+ obj = JSON . parse ( value ) ;
275+ } catch ( e ) {
276+ throw new ConfigurationError ( `Invalid JSON string provided: ${ e . message } ` ) ;
277+ }
278+ } else {
279+ obj = value ;
280+ }
272281 return Object . fromEntries (
273282 Object . entries ( obj ) . map ( ( [
274283 key ,
You can’t perform that action at this time.
0 commit comments