diff --git a/CHANGELOG.md b/CHANGELOG.md index 512ad9bb0c0..bbbb5c2ba30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,2 @@ +- Fix Task Queue Emulator error handling to display error message properly. (#7916) - Fixed some misleading logs when using the Data Connect emulator with `FIREBASE_DATACONNECT_POSTGRESQL_STRING` set. diff --git a/src/emulator/tasksEmulator.ts b/src/emulator/tasksEmulator.ts index 84ba5d61c31..f30af5b34e8 100644 --- a/src/emulator/tasksEmulator.ts +++ b/src/emulator/tasksEmulator.ts @@ -203,7 +203,11 @@ export class TasksEmulator implements EmulatorInstance { const locationId = req.params.location_id; const queueName = req.params.queue_name; if (!this.validateQueueId(queueName)) { - res.status(400).send("Invalid Queue ID"); + res.status(400).json({ + error: + "Queue ID must start with a letter followed by up to 62 letters, numbers, " + + "hyphens, or underscores and must end with a letter or a number", + }); return; } @@ -233,7 +237,7 @@ export class TasksEmulator implements EmulatorInstance { defaultUri: body.defaultUri, }; if (taskQueueConfig.rateLimits.maxConcurrentDispatches > 5000) { - res.status(400).send("cannot set maxConcurrentDispatches to a value over 5000"); + res.status(400).json({ error: "cannot set maxConcurrentDispatches to a value over 5000" }); return; }