Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass error data from SRHubResult to NSError object in callback #274

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
xcodeproj 'SignalR.Client.ObjC Example'
project 'SignalR.Client.ObjC Example.xcodeproj'
workspace '../SignalR.Client.ObjC'

target "OS X Example" do
Expand All @@ -13,4 +13,4 @@ target "iOS Example" do
platform :ios, '9.0'

pod 'SignalR-ObjC', :path => '..'
end
end
14 changes: 8 additions & 6 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ PODS:
- AFNetworking/UIKit (2.6.3):
- AFNetworking/NSURLConnection
- AFNetworking/NSURLSession
- SignalR-ObjC (2.0.1):
- SignalR-ObjC/Core (= 2.0.1)
- SignalR-ObjC/Core (2.0.1):
- SignalR-ObjC (2.0.2):
- SignalR-ObjC/Core (= 2.0.2)
- SignalR-ObjC/Core (2.0.2):
- AFNetworking (~> 2.0)
- SocketRocket (~> 0.4)
- SocketRocket (0.4.2)
Expand All @@ -32,11 +32,13 @@ DEPENDENCIES:

EXTERNAL SOURCES:
SignalR-ObjC:
:path: ".."
:path: ..

SPEC CHECKSUMS:
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
SignalR-ObjC: 7ec4f7ba12750224e94229f3653df3f1204955c6
SignalR-ObjC: 3913aa201f436cf21226e0016ca6c7e94265921a
SocketRocket: ffe08119b00ef982f6c37052a4705a057c8494ad

COCOAPODS: 0.39.0
PODFILE CHECKSUM: 3f8c8cf23eda999198a8c28081991f8fd0c6bf36

COCOAPODS: 1.0.1
104 changes: 52 additions & 52 deletions Example/SignalR.Client.ObjC Example.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
xcodeproj 'SignalR.Client.ObjC/SignalR.Client.ObjC'
project 'SignalR.Client.ObjC/SignalR.Client.ObjC.xcodeproj'
workspace 'SignalR.Client.ObjC'

target "SignalR.Client.iOS" do
Expand All @@ -23,4 +23,4 @@ target :"SignalR.Client.OSX" do
target :"SignalR.Client.OSXTests" do
pod 'OCMock'
end
end
end
4 changes: 3 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@ SPEC CHECKSUMS:
OCMock: 18c9b7e67d4c2770e95bb77a9cc1ae0c91fe3835
SocketRocket: ffe08119b00ef982f6c37052a4705a057c8494ad

COCOAPODS: 0.39.0
PODFILE CHECKSUM: b3a3a58c75f13f9a520b6c950906fdd364953a26

COCOAPODS: 1.0.1
60 changes: 30 additions & 30 deletions SignalR.Client.ObjC/SignalR.Client.ObjC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -522,12 +522,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 39302A051C6974C20061C6B5 /* Build configuration list for PBXNativeTarget "SignalR.Client.OSX" */;
buildPhases = (
BE773CA6D603623DBCDFD6AF /* Check Pods Manifest.lock */,
BE773CA6D603623DBCDFD6AF /* [CP] Check Pods Manifest.lock */,
393029EF1C6974C10061C6B5 /* Sources */,
393029F01C6974C10061C6B5 /* Frameworks */,
393029F11C6974C10061C6B5 /* Headers */,
393029F21C6974C10061C6B5 /* Resources */,
7C5BAF419D1DB75581A41B87 /* Copy Pods Resources */,
7C5BAF419D1DB75581A41B87 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -542,12 +542,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 39302A081C6974C20061C6B5 /* Build configuration list for PBXNativeTarget "SignalR.Client.OSXTests" */;
buildPhases = (
537C4819A81E84FE2982C1CF /* Check Pods Manifest.lock */,
537C4819A81E84FE2982C1CF /* [CP] Check Pods Manifest.lock */,
393029F91C6974C20061C6B5 /* Sources */,
393029FA1C6974C20061C6B5 /* Frameworks */,
393029FB1C6974C20061C6B5 /* Resources */,
67E90B84652BAD667E4611D1 /* Embed Pods Frameworks */,
0B029DDB5BC07F36BE28C47C /* Copy Pods Resources */,
67E90B84652BAD667E4611D1 /* [CP] Embed Pods Frameworks */,
0B029DDB5BC07F36BE28C47C /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -563,12 +563,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 39302A3F1C6978AC0061C6B5 /* Build configuration list for PBXNativeTarget "SignalR.Client.iOS" */;
buildPhases = (
42E081C85DE4F4916D0F3D75 /* Check Pods Manifest.lock */,
42E081C85DE4F4916D0F3D75 /* [CP] Check Pods Manifest.lock */,
39302A291C6978AB0061C6B5 /* Sources */,
39302A2A1C6978AB0061C6B5 /* Frameworks */,
39302A2B1C6978AB0061C6B5 /* Headers */,
39302A2C1C6978AB0061C6B5 /* Resources */,
796268F885EFEC8F1356854A /* Copy Pods Resources */,
796268F885EFEC8F1356854A /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -583,12 +583,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 39302A421C6978AC0061C6B5 /* Build configuration list for PBXNativeTarget "SignalR.Client.iOSTests" */;
buildPhases = (
21C56E6B6FDFA0220435E7AD /* Check Pods Manifest.lock */,
21C56E6B6FDFA0220435E7AD /* [CP] Check Pods Manifest.lock */,
39302A331C6978AC0061C6B5 /* Sources */,
39302A341C6978AC0061C6B5 /* Frameworks */,
39302A351C6978AC0061C6B5 /* Resources */,
2AC719B5534D658A6E1038BA /* Embed Pods Frameworks */,
1A11AFB25C13B6568AF7E084 /* Copy Pods Resources */,
2AC719B5534D658A6E1038BA /* [CP] Embed Pods Frameworks */,
1A11AFB25C13B6568AF7E084 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -676,149 +676,149 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
0B029DDB5BC07F36BE28C47C /* Copy Pods Resources */ = {
0B029DDB5BC07F36BE28C47C /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-SignalR.Client.OSX-SignalR.Client.OSXTests/Pods-SignalR.Client.OSX-SignalR.Client.OSXTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
1A11AFB25C13B6568AF7E084 /* Copy Pods Resources */ = {
1A11AFB25C13B6568AF7E084 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-SignalR.Client.iOS-SignalR.Client.iOSTests/Pods-SignalR.Client.iOS-SignalR.Client.iOSTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
21C56E6B6FDFA0220435E7AD /* Check Pods Manifest.lock */ = {
21C56E6B6FDFA0220435E7AD /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
2AC719B5534D658A6E1038BA /* Embed Pods Frameworks */ = {
2AC719B5534D658A6E1038BA /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Embed Pods Frameworks";
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-SignalR.Client.iOS-SignalR.Client.iOSTests/Pods-SignalR.Client.iOS-SignalR.Client.iOSTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
42E081C85DE4F4916D0F3D75 /* Check Pods Manifest.lock */ = {
42E081C85DE4F4916D0F3D75 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
537C4819A81E84FE2982C1CF /* Check Pods Manifest.lock */ = {
537C4819A81E84FE2982C1CF /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
67E90B84652BAD667E4611D1 /* Embed Pods Frameworks */ = {
67E90B84652BAD667E4611D1 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Embed Pods Frameworks";
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-SignalR.Client.OSX-SignalR.Client.OSXTests/Pods-SignalR.Client.OSX-SignalR.Client.OSXTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
796268F885EFEC8F1356854A /* Copy Pods Resources */ = {
796268F885EFEC8F1356854A /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-SignalR.Client.iOS/Pods-SignalR.Client.iOS-resources.sh\"\n";
showEnvVarsInLog = 0;
};
7C5BAF419D1DB75581A41B87 /* Copy Pods Resources */ = {
7C5BAF419D1DB75581A41B87 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Copy Pods Resources";
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-SignalR.Client.OSX/Pods-SignalR.Client.OSX-resources.sh\"\n";
showEnvVarsInLog = 0;
};
BE773CA6D603623DBCDFD6AF /* Check Pods Manifest.lock */ = {
BE773CA6D603623DBCDFD6AF /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Check Pods Manifest.lock";
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
3 changes: 2 additions & 1 deletion SignalR.Client/Hubs/SRHubProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
#import <Foundation/Foundation.h>
#import "SRHubConnectionInterface.h"
#import "SRHubProxyInterface.h"


extern NSString * const kErrorData;
/**
* An `SRHubProxy` object provides support for SignalR Hubs
*/
Expand Down
5 changes: 5 additions & 0 deletions SignalR.Client/Hubs/SRHubProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#import "SRHubConnectionInterface.h"
#import "SRConnectionInterface.h"

NSString * const kErrorData = @"SRErrorData";

@interface SRHubProxy ()

@property (assign, nonatomic, readonly) id <SRHubConnectionInterface> connection;
Expand Down Expand Up @@ -122,6 +124,9 @@ - (void)invoke:(NSString *)method withArgs:(NSArray *)args completionHandler:(vo
NSMutableDictionary *userInfo = [NSMutableDictionary dictionary];
userInfo[NSLocalizedFailureReasonErrorKey] = NSInternalInconsistencyException;
userInfo[NSLocalizedDescriptionKey] = [NSString stringWithFormat:@"%@", result.error];
if (result.errorData) {
userInfo[kErrorData] = result.errorData;
}
NSError *error = [NSError errorWithDomain:[NSString stringWithFormat:NSLocalizedString(@"com.SignalR.SignalR-ObjC.%@",@""),NSStringFromClass([self class])]
code:0
userInfo:userInfo];
Expand Down