Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling #112

Closed
djvs opened this issue Jun 20, 2014 · 6 comments
Closed

Error handling #112

djvs opened this issue Jun 20, 2014 · 6 comments

Comments

@djvs
Copy link
Contributor

djvs commented Jun 20, 2014

How do we handle errors in the new uploadComplete style? Apparently it doesn't trigger at all when the server throws an error - instead ng-upload.min.js throws:

Uncaught SecurityError: Failed to read the 'contentDocument' property
from 'HTMLIFrameElement': Blocked a frame with origin 
"http://localhost:3000" from accessing a frame with origin "null".  
The frame requesting access has a protocol of "http", the frame being
accessed has a protocol of "data". Protocols must match.
@twilson63
Copy link
Owner

Good Point, I would like to start an unstable branch and implement promises, then we could handle errors with the promise api. want to help? or have or suggestions?

@djvs
Copy link
Contributor Author

djvs commented Jun 21, 2014

Personally I would take the lazy way out and just throw that line inside of a try/catch(err), with a return of the error. I don't know much about the JS promise API, but at the moment the support looks very low:

http://caniuse.com/promises

@djvs
Copy link
Contributor Author

djvs commented Jun 23, 2014

OK, I added error handling. See this Gist:

https://gist.github.com/djvs/7c82f7395624d85c7e03

specifically lines 96 and 185-219 (one big try-catch). This adds support for an optional error-catcher attribute in the <form> tag. You may want to double check, I basically used your method for the ng-upload attribute.

@kencaron
Copy link

This would be huge for me. +1

@twilson63
Copy link
Owner

I will try to incorporate it by the weekend, I have been so busy, if you
need it before, wrapping it up in a pull-request would be welcomed.

Thanks

Tom

On Thu, Jul 31, 2014 at 1:49 PM, Ken Caron notifications@github.com wrote:

This would be huge for me.


Reply to this email directly or view it on GitHub
#112 (comment).

Tom Wilson
Jack Russell Software Company Division of CareKinesis
494 Wando Park Blvd
Mount Pleasant, SC 29464
Phone: 843-606-6484
Mobile: 843-469-5856
Email: tom@jackhq.com
Web: http://www.jackhq.com
Calendar:
http://www.google.com/calendar/embed?src=tom%40jackrussellsoftware.com&ctz=America/New_York
http://www.jackhq.com/calendar

This e-mail may contain information that is confidential, privileged or
otherwise protected from disclosure by the Health Insurance Portability and
Accountability Act (HIPAA) and other state and federal laws. This
information is intended only for the individual names above. Any review,
use disclosure or dissemination of this material is strictly prohibited.
If you receive this information in error, please notify CareKinesis
immediately at 888-974-2763 and delete the original at once.

@twilson63
Copy link
Owner

Added to master js, but not released...

Let me know if you see any issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants