Skip to content

Commit

Permalink
⭐️ Impl: Add RNIGenericErrorDefaultable+Default
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicstop committed May 10, 2023
1 parent f10dd71 commit a6b905e
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ import Foundation
public enum RNIGenericErrorCode:
String, Codable, CaseIterable, RNIGenericErrorDefaultable {

case runtimeError, libraryError, reactError, unknownError,
invalidArgument, outOfBounds, invalidReactTag, nilValue;
// placeholder
case unspecified;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// RNIGenericErrorDefaultable+Default.swift
// react-native-ios-modal
//
// Created by Dominic Go on 5/10/23.
//

import Foundation

public extension RNIGenericErrorDefaultable {
static var runtimeError: Self {
Self.runtimeError
};

static var libraryError: Self {
Self.libraryError
};

static var reactError: Self {
Self.reactError
};

static var unknownError: Self {
Self.unknownError
};

static var invalidArgument: Self {
Self.invalidArgument
};

static var outOfBounds: Self {
Self.outOfBounds
};

static var invalidReactTag: Self {
Self.invalidReactTag
};

static var nilValue: Self {
Self.nilValue
};
};

0 comments on commit a6b905e

Please sign in to comment.