Update TelegramApiRequestException.java
https://github.com/rubenlagus/TelegramBots/issues/892 https://github.com/rubenlagus/TelegramBots/pull/893
This commit is contained in:
parent
4882040822
commit
00085adfd6
@ -84,8 +84,13 @@ public class TelegramApiRequestException extends TelegramApiException {
|
|||||||
return parameters;
|
return parameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* More detailed error description.
|
||||||
|
*
|
||||||
|
* @return assembled response code and reason
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String getMessage() {
|
||||||
if (apiResponse == null) {
|
if (apiResponse == null) {
|
||||||
return super.toString();
|
return super.toString();
|
||||||
} else if (errorCode == null) {
|
} else if (errorCode == null) {
|
||||||
@ -94,4 +99,15 @@ public class TelegramApiRequestException extends TelegramApiException {
|
|||||||
return super.toString() + ": [" + errorCode + "] " + apiResponse;
|
return super.toString() + ": [" + errorCode + "] " + apiResponse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Just left as backward compatibility if anybody used this in version 5.1.1 or older.
|
||||||
|
*
|
||||||
|
* @return the getMessage string
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user