Don't localize error messages
This commit is contained in:
parent
6bc31d922e
commit
750af31a80
@ -42,7 +42,7 @@ The `CameraError` type is a baseclass type for all other errors and provides the
|
|||||||
* `code`: A typed code in the form of `{domain}/{code}` that can be used to quickly identify and group errors
|
* `code`: A typed code in the form of `{domain}/{code}` that can be used to quickly identify and group errors
|
||||||
* `message`: A non-localized message text that provides a more information and context about the error and possibly problematic values.
|
* `message`: A non-localized message text that provides a more information and context about the error and possibly problematic values.
|
||||||
* `cause?`: An `ErrorWithCause` instance that provides information about the cause of the error. (Optional)
|
* `cause?`: An `ErrorWithCause` instance that provides information about the cause of the error. (Optional)
|
||||||
* `cause.message`: The message of the error that caused the camera error. This is localized on iOS.
|
* `cause.message`: The message of the error that caused the camera error.
|
||||||
* `cause.code?`: The native error's error-code. (iOS only)
|
* `cause.code?`: The native error's error-code. (iOS only)
|
||||||
* `cause.domain?`: The native error's domain. (iOS only)
|
* `cause.domain?`: The native error's domain. (iOS only)
|
||||||
* `cause.details?`: More dictionary-style information about the cause. (iOS only)
|
* `cause.details?`: More dictionary-style information about the cause. (iOS only)
|
||||||
|
@ -203,7 +203,7 @@ final class CameraView: UIView {
|
|||||||
self.captureSession.startRunning()
|
self.captureSession.startRunning()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
invokeOnError(.unknown(message: error.localizedDescription), cause: error as NSError)
|
invokeOnError(.unknown(message: error.description), cause: error as NSError)
|
||||||
}
|
}
|
||||||
|
|
||||||
internal final func setTorchMode(_ torchMode: String) {
|
internal final func setTorchMode(_ torchMode: String) {
|
||||||
@ -251,7 +251,7 @@ final class CameraView: UIView {
|
|||||||
causeDictionary = [
|
causeDictionary = [
|
||||||
"code": cause.code,
|
"code": cause.code,
|
||||||
"domain": cause.domain,
|
"domain": cause.domain,
|
||||||
"message": cause.localizedDescription,
|
"message": cause.description,
|
||||||
"details": cause.userInfo,
|
"details": cause.userInfo,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -296,7 +296,7 @@ final class CameraView: UIView {
|
|||||||
// activate current audio session because camera is active
|
// activate current audio session because camera is active
|
||||||
try audioSession.setActive(true)
|
try audioSession.setActive(true)
|
||||||
} catch let error as NSError {
|
} catch let error as NSError {
|
||||||
self.invokeOnError(.session(.audioSessionSetupFailed(reason: error.localizedDescription)), cause: error)
|
self.invokeOnError(.session(.audioSessionSetupFailed(reason: error.description)), cause: error)
|
||||||
setAutomaticallyConfiguresAudioSession(true)
|
setAutomaticallyConfiguresAudioSession(true)
|
||||||
}
|
}
|
||||||
let end = DispatchTime.now()
|
let end = DispatchTime.now()
|
||||||
|
@ -28,7 +28,7 @@ class PhotoCaptureDelegate: NSObject, AVCapturePhotoCaptureDelegate {
|
|||||||
delegatesReferences.removeAll(where: { $0 == self })
|
delegatesReferences.removeAll(where: { $0 == self })
|
||||||
}
|
}
|
||||||
if let error = error {
|
if let error = error {
|
||||||
return promise.reject(error: .capture(.unknown(message: error.localizedDescription)), cause: error as NSError)
|
return promise.reject(error: .capture(.unknown(message: error.description)), cause: error as NSError)
|
||||||
}
|
}
|
||||||
|
|
||||||
let error = ErrorPointer(nilLiteral: ())
|
let error = ErrorPointer(nilLiteral: ())
|
||||||
@ -67,7 +67,7 @@ class PhotoCaptureDelegate: NSObject, AVCapturePhotoCaptureDelegate {
|
|||||||
delegatesReferences.removeAll(where: { $0 == self })
|
delegatesReferences.removeAll(where: { $0 == self })
|
||||||
}
|
}
|
||||||
if let error = error {
|
if let error = error {
|
||||||
return promise.reject(error: .capture(.unknown(message: error.localizedDescription)), cause: error as NSError)
|
return promise.reject(error: .capture(.unknown(message: error.description)), cause: error as NSError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ func withPromise(_ promise: Promise, _ block: () throws -> Any?) {
|
|||||||
} catch let error as CameraError {
|
} catch let error as CameraError {
|
||||||
promise.reject(error: error)
|
promise.reject(error: error)
|
||||||
} catch let error as NSError {
|
} catch let error as NSError {
|
||||||
promise.reject(error: CameraError.unknown(message: error.localizedDescription), cause: error)
|
promise.reject(error: CameraError.unknown(message: error.description), cause: error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ class RecordingDelegateWithCallback: NSObject, AVCaptureFileOutputRecordingDeleg
|
|||||||
delegateReferences.removeAll(where: { $0 == self })
|
delegateReferences.removeAll(where: { $0 == self })
|
||||||
}
|
}
|
||||||
if let error = error {
|
if let error = error {
|
||||||
return callback([NSNull(), makeReactError(.capture(.unknown(message: error.localizedDescription)), cause: error as NSError)])
|
return callback([NSNull(), makeReactError(.capture(.unknown(message: error.description)), cause: error as NSError)])
|
||||||
}
|
}
|
||||||
|
|
||||||
let seconds = CMTimeGetSeconds(output.recordedDuration)
|
let seconds = CMTimeGetSeconds(output.recordedDuration)
|
||||||
|
@ -55,7 +55,7 @@ export interface ErrorWithCause {
|
|||||||
*/
|
*/
|
||||||
domain?: string;
|
domain?: string;
|
||||||
/**
|
/**
|
||||||
* The native error description (Localized on iOS)
|
* The native error description
|
||||||
*
|
*
|
||||||
* * iOS: `NSError.message`
|
* * iOS: `NSError.message`
|
||||||
* * Android: `Throwable.message`
|
* * Android: `Throwable.message`
|
||||||
|
Loading…
Reference in New Issue
Block a user