From 517cf6ad5ec0d261d96b5e737fcda699fcbdc93b Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Fri, 29 Sep 2023 17:38:39 -0400 Subject: [PATCH] api: add `User error (reporting allowed):` designation for scripts to use there are cases where we known an error is a user error and want to self diagnose an issue for the user but at the same time still want them to be able to send in logs. Such cases might include seeing how common an issue is or finding new issues where previously not thought possible. --- api | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api b/api index be8464c984..f1d55a8ba6 100755 --- a/api +++ b/api @@ -2318,11 +2318,21 @@ sudo apt install --reinstall lsb_release") fi #Individual scripts can self-diagnose by outputting "User error: ", followed by the diagnosis. + #In this case we do not allow sending the error report to Pi-Apps if grep -q "^User error: " <<<"$errors" ;then #return all lines of output after a line mentions "User error: " error_caption+=("$(sed -ne '/^User error: /,$ p' <<<"$errors" | sed 's/^User error: //g')") error_type="system" fi + + #Individual scripts can self-diagnose by outputting "User error (reporting allowed): ", followed by the diagnosis. + #In this case we still allow sending the error report to Pi-Apps + if grep -q "^User error (reporting allowed): " <<<"$errors" ;then + #return all lines of output after a line mentions "User error (reporting allowed): " + error_caption+=("$(sed -ne '/^User error (reporting allowed): /,$ p' <<<"$errors" | sed 's/^User error (reporting allowed): //g')") + # system internet and package error types are blocked from sending error reports. Specify some other error type. + error_type="unknown" + fi #if no known error was detected, set the error_type to 'unknown' [ -z "$error_type" ] && error_type=unknown