From b1be74a56ff94308926f1257479776750816b804 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Tue, 18 Jun 2019 19:45:52 +0200 Subject: [PATCH] support processing of Error types in notifications, adresses #441 --- js/privatebin.js | 3 +++ tpl/bootstrap.php | 2 +- tpl/page.php | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index f43441c4..354d0030 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -1544,6 +1544,9 @@ jQuery.PrivateBin = (function($, RawDeflate) { } else if (typeof args === 'string') { // convert string to array if needed args = [args]; + } else if (args instanceof Error) { + // extract message into array if needed + args = [args.message]; } // pass to custom handler if defined diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index a53cdc78..51255245 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -72,7 +72,7 @@ if ($MARKDOWN): endif; ?> - + diff --git a/tpl/page.php b/tpl/page.php index 84aefd30..a5e5926d 100644 --- a/tpl/page.php +++ b/tpl/page.php @@ -50,7 +50,7 @@ if ($MARKDOWN): endif; ?> - +