Skip to content

Commit eb56584

Browse files
committed
Updated client to include errors
1 parent b643551 commit eb56584

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

lib/buffer_client.rb

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,36 @@ def error
3838
def get_auth_token
3939
token = @auth_api.get_auth_token
4040
if @auth_api.has_error?
41+
@error = @auth_api.get_error
42+
end
4143

44+
token
4245
end
4346

4447
def get_user_id
45-
@user_api.get_user_id
48+
user_id = @user_api.get_user_id
49+
if @user_api.has_error?
50+
@error = @user_api.get_error
51+
end
52+
53+
user_id
4654
end
4755

4856
def get_user_json
49-
@profile_api.get_user_json
57+
user_json = @user_api.get_user_json
58+
if @user_api.has_error?
59+
@error = @user_api.get_error
60+
end
61+
62+
user_json
5063
end
5164

5265
def get_user_profiles
53-
ProfileApi.get_profiles
66+
profiles = @profile_api.get_profiles
67+
if @profile_api.has_error?
68+
@error = @profile_api.get_error
69+
end
70+
71+
profiles
5472
end
5573
end

0 commit comments

Comments
 (0)