VBError is a base class for your own errors. It makes error creation and handling more effective.
When handling error you can check class instead of making domain+code check.
You can also create same errors(domain+code) in different parts of code by creating an instance of the same VBError subclass.
Use case 1.
- Create VBError subclass.
- Call +errorWithCode:, errorWithUserInfo:, +errorWithCode:userInfo: or +errorWithError: to create an instance.
Use case 2
- Create VBError subclass.
- Implement +code method.
- Call +error, +errorWithUserInfo: to create an instance.
Use CocoaPods
pod 'VBError'
or
Drag VBError dir into your project.
VBError is available under the MIT license. See the LICENSE file for more info.