whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Show modal response for exceptions as well
Date Fri, 19 Jul 2019 21:03:55 GMT
This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new c530a72  Show modal response for exceptions as well
c530a72 is described below

commit c530a72524b106733958ce87d6bc0af62f9c023b
Author: Sebb <sebb@apache.org>
AuthorDate: Fri Jul 19 22:03:51 2019 +0100

    Show modal response for exceptions as well
---
 www/roster/views/person/main.js.rb | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/www/roster/views/person/main.js.rb b/www/roster/views/person/main.js.rb
index 1a53557..5304a88 100644
--- a/www/roster/views/person/main.js.rb
+++ b/www/roster/views/person/main.js.rb
@@ -378,7 +378,14 @@ class Person < Vue
       },
 
       error: ->(response) {
-        alert response.statusText
+        json = response.responseJSON
+        if json.exception
+          @response_title = json.exception
+          @response = JSON.stringify(json, nil, 2)
+          jQuery('div.modal').modal('show')
+        else
+          alert response.statusText
+        end
       },
 
       complete: ->(response) do


Mime
View raw message