Skip to content

Commit

Permalink
Fixed Classcast exception error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaison Titus committed Jul 28, 2017
1 parent 4389c15 commit 7925e48
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package io.hasura.sdk.responseConverter;

import android.util.Log;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

Expand Down Expand Up @@ -31,7 +29,10 @@ public HasuraException fromIOException(IOException e) {

@Override
public HasuraException castException(Exception e) {
return (HasuraException) e;
if (e instanceof HasuraException) {
return (HasuraException) e;
}
return new HasuraException(HasuraErrorCode.UNKNOWN, "Unable to cast Exeception : " + e.getMessage());
}

//TODO: UGLY -FIX/CHANGE
Expand Down

0 comments on commit 7925e48

Please sign in to comment.