Skip to content

Commit

Permalink
improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
choden-dev committed Mar 11, 2024
1 parent 2ea1c3c commit 7a63c0d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/src/business-layer/security/Firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ import {
import * as _admin from "firebase-admin"

const keysEnvVar = process.env.GOOGLE_SERVICE_ACCOUNT_JSON
let keys

if (!keysEnvVar && process.env.JEST_WORKER_ID !== undefined) {
throw new Error("The $CREDS environment variable was not found!")
}

const keys = JSON.parse(keysEnvVar)
if (process.env.JEST_WORKER_ID !== undefined) {
keys = JSON.parse(keysEnvVar)
}

if (process.env.DEV || process.env.JEST_WORKER_ID !== undefined) {
process.env.FIRESTORE_EMULATOR_HOST = `${EMULATOR_HOST}:${EMULATOR_FIRESTORE_PORT}`
Expand Down

0 comments on commit 7a63c0d

Please sign in to comment.