From: gustavo Date: Sat, 27 Aug 2016 21:54:40 +0000 (+0200) Subject: stomp client, show JSON messages X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=be8ef25a13d76bd886960c078ca5be4fc86d79a7;p=JavaScriptForFun stomp client, show JSON messages --- diff --git a/angularjs/stomp/src/stomp/app/example/example.controller.js b/angularjs/stomp/src/stomp/app/example/example.controller.js index 56b9d14..35c31c5 100644 --- a/angularjs/stomp/src/stomp/app/example/example.controller.js +++ b/angularjs/stomp/src/stomp/app/example/example.controller.js @@ -89,20 +89,12 @@ function errorCallback(error) { // display the error's message header: - if (error.headers) { - alert(error.headers.message); - } else { - alert(error); - } + alert('error call back: \n' + JSON.stringify(error, null, 4)); } function subscribeCallback(message) { // called when the client receives a STOMP message from the server - if (message.body) { - alert('got message with body ' + message.body); - } else { - alert('got empty message'); - } + alert('subscribe message: \n' + JSON.stringify(message, null, 4)); } function disconnectCallback() {