No standardised error logging like other languages
- Dominant language
- Go
- Stars
- 3.8k
- Forks
- 578
- Avg merge
- 8h 18m
- Merged PRs (30d)
- 1
Description
**Is your feature request related to a problem? Please describe.**
If a golang lambda handler returns an error, you simply get the error message in the logs. For other languages this is a more structured error syntax, for example NodeJS:
`2019-06-05T22:11:27.082Z 8bbbfb91-a3ff-4502-b1b7-cb8f6658de64 ERROR Invoke Error {"errorType":"ReferenceError","errorMessage":"x is not defined","stack":["ReferenceError: x is not defined"," at Runtime.exports.handler (/var/task/index.js:2:3)"," at Runtime.handleOnce (/var/runtime/Runtime.js:63:25)"," at process._tickCallback (internal/process/next_tick.js:68:7)"]}`
Example logs from Ruby:
```
START RequestId: 5ce6a15a-f156-11e8-b8aa-25371a5ca2a3 Version: $LATEST
Processing event...
Error raised from handler method
{
"errorMessage": "no implicit conversion of String into Integer",
"errorType": "Function",
"stackTrace": [
"/var/task/function.rb:3:in `first'",
"/var/task/function.rb:3:in `handler'"
]
}
END RequestId: 5ce6a15a-f156-11e8-b8aa-25371a5ca2a3
```
This means we can't do any pattern matching across golang lambda functions without manually inserting error syntax into a shared error handling library - I think this should be out of the box from Lambda itself.
**Describe the solution you'd like**
One of:
a) If the Lambda errors from code, output a log line saying `ERROR RequestId: xxx Version: xxx` just like the START / END / REPORT lines
b) If the Lambda errors from code, add a STATUS to either the END or the REPORT log lines to make it clear it's been an error
**BONUS POINTS**
Add OUT OF MEMORY and TIMEOUT to the STATUS as well as just OK and ERROR.
Contributor guide
Assessment
This issue has not been assessed yet.