| 1 | // For license of this file, see <project-root-folder>/LICENSE.md.cxx . . $ `<file>/src/librssguard/exceptions/scriptexception.cpp`/ |
| 2 | |
| 3 | #include "exceptions/scriptexception.h"cxx . . $ `<file>/src/librssguard/exceptions/scriptexception.h`/ |
| 4 | |
| 5 | #include "definitions/definitions.h"cxx . . $ `<file>/src/librssguard/definitions/definitions.h`/ |
| 6 | |
| 7 | ScriptExceptioncxx . . $ ScriptException#::ScriptExceptioncxx . . $ ScriptException#ScriptException(25ffd164b4e810cc).(Reasoncxx . . $ ScriptException#Reason# reason, const QStringcxx . . $ QString#& message) |
| 8 | : ApplicationExceptioncxx . . $ ApplicationException#(messagecxx . . $ QString#QString(132dd6869045752b).), m_reasoncxx . . $ ScriptException#m_reason.(reason) { |
| 9 | if (message.isEmptycxx . . $ QString#isEmpty(3482b152b9333168).()) { |
| 10 | setMessagecxx . . $ ApplicationException#setMessage(3520e46b33348bf6).(messageForReasoncxx . . $ ScriptException#messageForReason(4b5ac30c28c3b3b2).(reason)); |
| 11 | } |
| 12 | else if (reason == ScriptExceptioncxx . . $ ScriptException#::Reasoncxx . . $ ScriptException#Reason#::InterpreterErrorcxx . . $ ScriptException#Reason#InterpreterError. || reason == ScriptExceptioncxx . . $ ScriptException#::Reasoncxx . . $ ScriptException#Reason#::OtherErrorcxx . . $ ScriptException#Reason#OtherError.) { |
| 13 | setMessagecxx . . $ ApplicationException#setMessage(3520e46b33348bf6).(messageForReasoncxx . . $ ScriptException#messageForReason(4b5ac30c28c3b3b2).(reason) + QSLcxx . . $ `src/librssguard/definitions/definitions.h:442:9`!(": '%1'").argcxx . . $ QString#arg(ad0bca07273edcc2).(message)); |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | ScriptExceptioncxx . . $ ScriptException#::Reasoncxx . . $ ScriptException#Reason# ScriptExceptioncxx . . $ ScriptException#::reasoncxx . . $ ScriptException#reason(78ecade694679fed).() const { |
| 18 | return m_reasoncxx . . $ ScriptException#m_reason.; |
| 19 | } |
| 20 | |
| 21 | QStringcxx . . $ QString# ScriptExceptioncxx . . $ ScriptException#::messageForReasoncxx . . $ ScriptException#messageForReason(4b5ac30c28c3b3b2).(ScriptExceptioncxx . . $ ScriptException#::Reasoncxx . . $ ScriptException#Reason# reason) const { |
| 22 | switch (reason) { |
| 23 | case ScriptExceptioncxx . . $ ScriptException#::Reasoncxx . . $ ScriptException#Reason#::ExecutionLineInvalidcxx . . $ ScriptException#Reason#ExecutionLineInvalid.: |
| 24 | return trcxx . . $ ScriptException#tr(75d9f1c324b4579d).("script line is not well-formed"); |
| 25 | |
| 26 | case ScriptExceptioncxx . . $ ScriptException#::Reasoncxx . . $ ScriptException#Reason#::InterpreterErrorcxx . . $ ScriptException#Reason#InterpreterError.: |
| 27 | return trcxx . . $ ScriptException#tr(75d9f1c324b4579d).("script threw an error"); |
| 28 | |
| 29 | case ScriptExceptioncxx . . $ ScriptException#::Reasoncxx . . $ ScriptException#Reason#::InterpreterNotFoundcxx . . $ ScriptException#Reason#InterpreterNotFound.: |
| 30 | return trcxx . . $ ScriptException#tr(75d9f1c324b4579d).("script's interpreter was not found"); |
| 31 | |
| 32 | case ScriptExceptioncxx . . $ ScriptException#::Reasoncxx . . $ ScriptException#Reason#::InterpreterTimeoutcxx . . $ ScriptException#Reason#InterpreterTimeout.: |
| 33 | return trcxx . . $ ScriptException#tr(75d9f1c324b4579d).("script execution took too long"); |
| 34 | |
| 35 | case ScriptExceptioncxx . . $ ScriptException#::Reasoncxx . . $ ScriptException#Reason#::OtherErrorcxx . . $ ScriptException#Reason#OtherError.: |
| 36 | default: |
| 37 | return trcxx . . $ ScriptException#tr(75d9f1c324b4579d).("unknown error"); |
| 38 | } |
| 39 | } |