hectr / errorkit Goto Github PK
View Code? Open in Web Editor NEWiOS library for making NSError handling easier
License: MIT License
iOS library for making NSError handling easier
License: MIT License
In this commit AFNetworking/AFNetworking@78d7a96 to AFNetworking in June 2014, @mattt changed the error domain from AFNetworkingErrorDomain
into AFURLRequestSerializationErrorDomain
and AFURLResponseSerializationErrorDomain
. As such, ErrorKit does not work with AFNetworking errors anymore as ErrorKit still looks for the old error domain.
Hi Héctor,
Could you please create a tag on master to match the version in the podspec file (or update it with whatever version you'd like to use)?
One of the main advantage of using CocoaPods is to be able to point to a specific tag.
Thanks
As per Apple doc, it looks like UIAlertView
, UIActionSheet
are deprecated in iOS 8. (Note that UIAlertViewDelegate
, UIActionSheetDelegate
are also deprecated.)
Could ErrorKit be updated to use UIAlertController
, instead, for iOS >= 8 ?
Thanks.
How do you translate this? Looking at "Geocode Found No Result" output from CoreLocation strings and feel that something is wrong. :)
Hi,
If I use this code:
[[UIAlertView alertWithTitle:NSLocalizedString(@"Synchronization Failed", nil)
error:error] show];
it crashes with the following message: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSInvocation _invocationWithMethodSignature:frame:]: method signature argument cannot be nil'
The problem seems to be that UIAlertView+ErrorKit
's alertView:clickedButtonAtIndex:
delegate method calls attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:
passing it a nil
selector.
I'm still trying to wrap my head around the code and how it's supposed to work so maybe I'm doing something wrong.
Basically here's my code:
MRErrorBuilder *errorBuilder = [MRErrorBuilder builderWithDomain:IFErrorDomain
code:-1
description:NSLocalizedString(@"Synchronization Failed", nil)];
[errorBuilder setLocalizedFailureReason:NSLocalizedString(@"One or more error(s) occurred during data synchronization.", nil)];
[errorBuilder setLocalizedRecoveryOptions:@[@"Retry"]];
MRBlockRecoveryAttempter *recoveryAttempter = [[MRBlockRecoveryAttempter alloc] initWithBlock:^BOOL(NSError *error, NSUInteger recoveryOption) {
if (0 == recoveryOption)
{
[self sync];
return YES;
}
return NO;
}];
[errorBuilder setRecoveryAttempter:recoveryAttempter];
NSError *error = [errorBuilder error];
[[UIAlertView alertWithTitle:NSLocalizedString(@"Synchronization Failed", nil)
error:error] show];
Hi,
On iOS the application delegate is chained after the application in the responder chain (view->view controller->window->application->application delegate).
Now I'd like to customize how errors appear. And I'd like to do that inside my app delegate. It's in the responder chain, so that should be cool. Unfortunately the error is already presented in the ErrorKit category on UIApplication.
Now I could implement -application:willPresentError:
in the application delegate and return nil
and present the error myself, but that would break the idea of the responder chain (plus return NO
on -[UIApplication presentError:]
).
What's your suggestion for this case?
Looking forward to hearing from you. Thanks for the lib!
-ullrich
ErrorKitDefines.h
defines the macros based on what library/framework is imported in the project. The problem is that if, for example, I link to the Security framework but don't want to use the ErrorKit/Security subspec ErrorKit will still define ERROR_KIT_SECURITY
and then fail on importing MRErrorFormatter_Security.h
What are your thoughts on this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.