mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 08:44:04 +00:00
Truncate long responses
This commit is contained in:
parent
c124f3a43e
commit
9820f57c64
2 changed files with 2 additions and 0 deletions
|
@ -444,6 +444,7 @@ async function evaluateJsonQuery(data, jsonPath, jsonPathOperator, expectedValue
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
response = (response.toString().length > 50) ? `${response.substring(0, 50)}… (truncated)` : response.toString();
|
||||||
throw new Error(`Error evaluating JSON query: ${err.message}. Response from server was: ${response}`);
|
throw new Error(`Error evaluating JSON query: ${err.message}. Response from server was: ${response}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -709,6 +709,7 @@ export async function evaluateJsonQuery(data: any, jsonPath: string, jsonPathOpe
|
||||||
response // The response from the server or result from initial json-query evaluation
|
response // The response from the server or result from initial json-query evaluation
|
||||||
};
|
};
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
|
response = (response.toString().length > 50) ? `${response.substring(0, 50)}… (truncated)` : response.toString();// Truncate long responses to the console
|
||||||
throw new Error(`Error evaluating JSON query: ${err.message}. Response from server was: ${response}`);
|
throw new Error(`Error evaluating JSON query: ${err.message}. Response from server was: ${response}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue