Files
librenms-librenms/LibreNMS/Exceptions/JsonAppBase64DecodeException.php
Zane C. Bowers-Hadley a166df006a base64 gzip compression support for json_app_get (#14169)
* add lnms_return_optimizer

* add compression test using zfs-v1

* minor style fix

* save the original output if not json

* replace gzinflate with gzdecode as apparently that does not require yanking the header

* Minor comment cleanup. Also note it in the application notes as well.

* update docs on how it is called

* update the spelling of it in a few places

* and a few more

* dev docs updated a bit

* the suricata extend has native support for this now

* add exception handling for base64 and gzip decoding failure

* minor cleanup for new exceptions

* minor misc changes

* minor formatting fix

* more phpdoc tweaks

* minor formatting tweak

* remember to actually include the new exceptions

* more phpdoc tweaking

* correct name in JsonAppGzipDecodeException

* add debug and verbose output

* style fix

* not base64 is it starts with a line with only a integer
2022-10-21 10:05:49 -05:00

34 lines
661 B
PHP

<?php
namespace LibreNMS\Exceptions;
use Throwable;
class JsonAppBase64DecodeException extends JsonAppException
{
/**
* @var string
*/
private $output;
/**
* @param string $message The message.
* @param string $output The return from snmpget.
* @param int $code Error code.
* @return static
*/
public function __construct($message, $output, $code = 0, Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
$this->output = $output;
}
/**
* @return string
*/
public function getOutput()
{
return $this->output;
}
}