Messaging users from Web API 2.0

25 views
Skip to first unread message

mark goldin

unread,
Sep 11, 2015, 1:34:38 PM9/11/15
to AngularJS
What is a recommended way of sending messages back to Angular application in case or run time errors or any other (validation, permission, etc) issues?

Thanks

Sander Elias

unread,
Sep 11, 2015, 10:45:56 PM9/11/15
to AngularJS
Hi Mark,

Are you asking what to do on the server with this stuff, or are you asking on how to inform your user? 
To send error's back to the user from the server, I usually look for an http error code that fits, and put some (end user understandable) detail in the description.

Regards
Sander

Daniel Lidström

unread,
Sep 14, 2015, 8:08:09 AM9/14/15
to AngularJS
Here's an example api (for creating tasks) that combines success response status codes with error validation responses:

mark goldin

unread,
Sep 14, 2015, 10:31:27 AM9/14/15
to AngularJS

I am mostly looking for design patterns for backend to communicate business messages back to angular client.


--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/CyDlqi-pDm4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Sander Elias

unread,
Sep 16, 2015, 12:15:59 AM9/16/15
to AngularJS
Hi Mark,

Ok, then I did understand your question correctly, and my answer is correct. It is a good design patters to leverage the existing http error numbers, and add in your own error messages in the description part.

Regards
Sander 
Reply all
Reply to author
Forward
0 new messages