Commit c1af4b91 authored by Armando Lüscher's avatar Armando Lüscher Committed by GitHub

Merge branch 'develop' into bot_api_3.0

parents 7bd2196d b58500f0
......@@ -7,6 +7,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
### Added
- New entities, methods, update types and inline keyboard button for Payments (Bot API 3.0).
### Changed
- [:exclamation:][unreleased-correct-printerror] Corrected `ServerResponse->printError` method to print by default and return by setting `$return` parameter.
### Deprecated
### Removed
### Fixed
......@@ -145,6 +146,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
### Deprecated
- Move `hideKeyboard` to `removeKeyboard`.
[unreleased-correct-printerror]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#correct-printerror
[0.47.0-private-only-admin-commands]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#private-only-admin-commands
[0.46.0-bc-request-class-refactor]: https://github.com/php-telegram-bot/core/wiki/Breaking-backwards-compatibility#request-class-refactor
[0.46.0-sql-migration]: https://github.com/php-telegram-bot/core/tree/0.45.0/utils/db-schema-update/0.44.1-0.45.0.sql
......
......@@ -77,11 +77,23 @@ class ServerResponse extends Entity
/**
* Print error
*
* @return string
* @see https://secure.php.net/manual/en/function.print-r.php
*
* @param bool $return
*
* @return bool|string
*/
public function printError()
public function printError($return = false)
{
return 'Error N: ' . $this->getErrorCode() . ' Description: ' . $this->getDescription();
$error = sprintf('Error N: %s, Description: %s', $this->getErrorCode(), $this->getDescription());
if ($return) {
return $error;
}
echo $error;
return true;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment