You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case a request cannot be processed, e.g., because the provided JSON is malformed, the provided vectors have incompatible dimensions, the TCP server will return to the client an error report. This is a JSON with three attributes: (i) a key-value pair `"type": "Error"`, to allow the client to tell that an error has occurred, (ii) a `code`, which can be used to uniquely identify the type of error and (iii) a `message`, which offers some human-readable details.
134
+
If a request cannot be processed, for example because the JSON payload is
135
+
malformed, the request body is not valid UTF-8, or one of the provided vectors
136
+
has the wrong dimension, the TCP server returns an error report instead of a
137
+
solution.
135
138
136
-
For example, if the client provides an incompatible number of parameters, that is, if vector `parameter` is of the wrong length, then the server will return the following error:
139
+
The error report is a JSON document with three fields:
140
+
141
+
-`"type": "Error"` so the client can distinguish errors from successful solver
142
+
responses
143
+
-`code`, a machine-readable integer code
144
+
-`message`, a human-readable string with more context
145
+
146
+
In particular, the `message` field is now intended to be descriptive. For
147
+
dimension-related errors it includes the provided and expected lengths, and for
148
+
solver failures it includes the underlying solver-side reason whenever
149
+
available.
150
+
151
+
For example, if the client provides an incompatible number of parameters, that
152
+
is, if vector `parameter` has the wrong length, the server returns an error like
153
+
the following:
154
+
155
+
```json
156
+
{
157
+
"type": "Error",
158
+
"code": 3003,
159
+
"message": "wrong number of parameters: provided 1, expected 2"
160
+
}
161
+
```
162
+
163
+
Likewise, if the solver itself fails, the server returns code `2000` together
164
+
with the propagated solver reason, for example:
137
165
138
166
```json
139
167
{
140
-
"type": "Error",
141
-
"code": 3003,
142
-
"message": "wrong number of parameters"
168
+
"type": "Error",
169
+
"code": 2000,
170
+
"message": "problem solution failed: non-finite computation: gradient evaluation returned a non-finite value during an FBS step"
143
171
}
144
172
```
145
173
146
-
The following errors may be returned to the client
174
+
The following error codes may be returned to the client:
0 commit comments