Commit 49324dc
authored
Fall back to XML errors (minio#33)
MinIO may return XML errors. If JSON parsing fails, try XML as well.
Example:
```
λ mc admin inspect local2/mybucket/file/../../*
mc: <ERROR> Unable to inspect file. Failed to parse server response: invalid character '<' looking for beginning of value.
```
Error returned by generic handler `setRequestValidityHandler`.
After:
```
λ go build&&mc admin inspect local2/mybucket/file/../../*
mc: <ERROR> Unable to inspect file. Resource name contains bad components such as ".." or ".".
```
Also print content of unparsable content, like HTML, but at limited length.1 parent 4cef8ab commit 49324dc
1 file changed
+33
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
| |||
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
64 | | - | |
| 69 | + | |
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
68 | | - | |
69 | | - | |
70 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
74 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
75 | 103 | | |
76 | 104 | | |
77 | | - | |
78 | 105 | | |
79 | 106 | | |
80 | 107 | | |
| |||
0 commit comments