Skip to main content

read_answer

Function read_answer 

Source
pub fn read_answer(status: u16, raw: &str) -> Result<Judged, String>
Expand description

What: Read the gateway’s HTTP status and body into a verdict, or the message that follows Luna failed: . Why: It is the script’s three failure branches: a non-success status, no usable answer, and a refusal.

In TS you’d write (pseudocode):

if (!response.ok) throw new Error('HTTP ' + status + ' ' + raw.slice(0, 200));