Skip to content

Commit

Permalink
⭐️ Impl: Add RNIModalError
Browse files Browse the repository at this point in the history
Related:
* `TODO:2023-03-27-23-55-09` Refactor: Re-write `RNIModalView` error creation and handling.
  • Loading branch information
dominicstop committed May 12, 2023
1 parent 1854875 commit d25283b
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions ios/src_library/React Native/RNIModal/RNIModalError.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// RNIModalError.swift
// react-native-ios-modal
//
// Created by Dominic Go on 5/10/23.
//

import Foundation

public enum RNIModalErrorCode: String, RNIErrorCode {
case modalAlreadyVisible,
modalAlreadyHidden,
dismissRejected;
};

public struct RNIModalError: RNIError {

public typealias ErrorCode = RNIModalErrorCode;

public static var domain = "react-native-ios-modal";

public var code: RNIModalErrorCode;
public var message: String?;

public var debugMessage: String?;
public var debugData: Dictionary<String, Any>?;

public var fileID: String?;
public var functionName: String?;
public var lineNumber: Int?;

public init(
code: ErrorCode,
message: String?,
debugMessage: String?
) {
self.code = code;
self.message = message;
self.debugMessage = debugMessage;
};
};

0 comments on commit d25283b

Please sign in to comment.