Commit f19013f
committed
(GH-1759) Handle non-UTF-8 task output
Previously, we treated non-UTF-8 task output as simply non-JSON output,
putting it in a hash under the `_output` key. This violated a key
constraint of the task specification (task output must always be UTF-8)
and caused problems when we tried to print the result as JSON (either as
output or for logging).
We now explicitly check for non-UTF-8 characters when interpreting the
result and we throw away stdout entirely and replace it with an error if
it is invalid.
!bug
* **Task output that contains invalid UTF-8 is now rejected**
([#1759](#1759))
Tasks are defined as returning UTF-8, but Bolt didn't handle the
non-UTF-8 case explicitly, leading to messy error messages and stack
traces. The error should now be clear and meaningful.1 parent 9ea5be7 commit f19013f
2 files changed
+42
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
| |||
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
66 | 78 | | |
67 | 79 | | |
68 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
112 | 132 | | |
113 | 133 | | |
0 commit comments