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
The code snippet below is hard to decypher, I think the third failure case is thrown when the response is unable to be decoded into the requested type; which seems to occur when any algorithm error is thrown.
/**
* Parse server response into an AlgoResponse
*/
def apply(rawOutput: String, outputType: AlgorithmOutputType): AlgoResponse = {
val json = Json.parse(rawOutput)
Json.fromJson[AlgoResponseRaw](json) match {
case JsSuccess(AlgoResponseRaw(result, None, metadata),_) => AlgoSuccess(result, metadata.metadata, rawOutput)
case JsSuccess(AlgoResponseRaw(_, Some(error), metadata),_) => AlgoFailure(error.message, metadata.metadata, rawOutput)
case JsError(_) => AlgoFailure("Failed to parse algorithm response", Metadata(0, ContentTypeVoid, None), rawOutput)
}
}
Maybe this section should be more descriptive if this is intended functionality?
The text was updated successfully, but these errors were encountered:
The code snippet below is hard to decypher, I think the third failure case is thrown when the response is unable to be decoded into the requested type; which seems to occur when any algorithm error is thrown.
Maybe this section should be more descriptive if this is intended functionality?
The text was updated successfully, but these errors were encountered: