You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by GitBox <gi...@apache.org> on 2021/07/21 04:10:41 UTC

[GitHub] [guacamole-client] mike-jumper opened a new pull request #627: GUACAMOLE-1384: Ensure all $http error objects are wrapped in Guacamole error objects, even if the relevant request could not be sent.

mike-jumper opened a new pull request #627:
URL: https://github.com/apache/guacamole-client/pull/627


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [guacamole-client] necouchman merged pull request #627: GUACAMOLE-1384: Ensure all $http error objects are wrapped in Guacamole error objects, even if the relevant request could not be sent.

Posted by GitBox <gi...@apache.org>.
necouchman merged pull request #627:
URL: https://github.com/apache/guacamole-client/pull/627


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [guacamole-client] mike-jumper commented on a change in pull request #627: GUACAMOLE-1384: Ensure all $http error objects are wrapped in Guacamole error objects, even if the relevant request could not be sent.

Posted by GitBox <gi...@apache.org>.
mike-jumper commented on a change in pull request #627:
URL: https://github.com/apache/guacamole-client/pull/627#discussion_r674099847



##########
File path: guacamole/src/main/frontend/src/app/rest/services/requestService.js
##########
@@ -56,6 +56,11 @@ angular.module('rest').factory('requestService', ['$injector',
                 if (response.data)
                     throw new Error(response.data);
 
+                // Fall back to a generic internal error if the request couldn't
+                // even be issued (webapp is down, etc.)
+                else if ('data' in response)

Review comment:
       Yep - definitely different. The original `if (response.data)` test will only be true if `response.data` is truthy. For other values, such as if `response.data` is `null`, that test will fail, whereas `'data' in response` would succeed. This particular change provides a fallback `Error` representation for requests that have failed because the webapp cannot be reached at all.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [guacamole-client] necouchman commented on a change in pull request #627: GUACAMOLE-1384: Ensure all $http error objects are wrapped in Guacamole error objects, even if the relevant request could not be sent.

Posted by GitBox <gi...@apache.org>.
necouchman commented on a change in pull request #627:
URL: https://github.com/apache/guacamole-client/pull/627#discussion_r674009260



##########
File path: guacamole/src/main/frontend/src/app/rest/services/requestService.js
##########
@@ -56,6 +56,11 @@ angular.module('rest').factory('requestService', ['$injector',
                 if (response.data)
                     throw new Error(response.data);
 
+                // Fall back to a generic internal error if the request couldn't
+                // even be issued (webapp is down, etc.)
+                else if ('data' in response)

Review comment:
       Is this somehow different from the above `if (response.data)`? Or is it intended to replace that??




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org