Commit a56adbe
committed
Fix Unexpected token : in JSON
This fixes a bug where the deployment itself was legitimately failing,
but the error handling itself failed.
Specifically, I noticed that the error being thrown was unnecessarily
hiding the actual error, which obfuscated the real issue. The real
issue was that the error message was expected to return valid JSON,
but it was pseudo-JSON instead (no surrounding `{}`). By removing
the redundant JSON.stringify(JSON.parse(...)) wrapping of the message
I was able to see the actual issue in my case:
> "/httpsTrigger/url": domain: validation; keyword: type; message: instance does not match any allowed primitive type; allowed: ["string"]; found: "object"
which allowed me to realize that what I had done in the past with
AWS Lambda was not valid for GCP Cloud Functions (specifically
specifying the HTTP event with a method and cors support).1 parent 1e8dbb1 commit a56adbe
File tree
1 file changed
+2
-3
lines changed1 file changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
| 69 | + | |
71 | 70 | | |
72 | 71 | | |
73 | 72 | | |
| |||
0 commit comments