Commit 1210c2c
authored
Fix error reporting formatting (#98)
The stacktrace for an error was formatted as:
${message}
${stacktrace}
I'm pretty sure I saw that documented in Google Cloud's documentation
when I initially implemented this feature, but I can't find it anymore
and the current documentation from
https://cloud.google.com/error-reporting/docs/formatting-error-messages#log-error
now says:
> To log an error event that is a stack trace, write the error event as
> one of these types:
> [...]
>
> * A `jsonPayload` that includes a `message`, `stack_trace`, or
> `exception` field.
>
> You can specify more than one of those fields. If more than one of
> those fields is specified, then the order of evaluation is: `stack_trace`,
> then `exception`, and then `message`.
>
> If the `message` field is evaluated and if it isn't empty, then the
> stack trace is captured only when the field contains a stack trace in
> one of the supported programming language formats. The stack trace isn't
> captured by Error Reporting when an unsupported format is used.
>
> If your error event is formatted as a `ReportedErrorEvent` object,
> then copy its fields to the `jsonPayload`. For more information and an
> example, see Log an error that is formatted as a ReportedErrorEvent
> object.
There's no mention of this weird `${message}\n${stacktrace}` anymore, so
let's get rid of it.1 parent 94c3ce8 commit 1210c2c
3 files changed
+17
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 32 | + | |
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
40 | 50 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
0 commit comments