Browse Source

Update packages/nocodb/src/version-upgrader/upgraders/0225002_ncDatasourceDecrypt.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
pull/9661/head
Pranav C 2 months ago committed by GitHub
parent
commit
01d6116968
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      packages/nocodb/src/version-upgrader/upgraders/0225002_ncDatasourceDecrypt.ts

4
packages/nocodb/src/version-upgrader/upgraders/0225002_ncDatasourceDecrypt.ts

@ -34,8 +34,8 @@ const decryptConfigWithFallbackKey = async ({
// validate by parsing JSON // validate by parsing JSON
try { try {
parsedVal = JSON.parse(decryptedVal); parsedVal = JSON.parse(decryptedVal);
} catch { } catch (parseError) {
throw new Error('JSON parse failed'); throw new Error(`JSON parse failed: ${parseError.message}`);
} }
// if parsed value is null, return null // if parsed value is null, return null
return parsedVal === null ? null : decryptedVal; return parsedVal === null ? null : decryptedVal;

Loading…
Cancel
Save