Skip to content

Commit

Permalink
Fix response of attach/getOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
slinkydeveloper committed May 13, 2024
1 parent cd7332d commit 1411eff
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import dev.restate.sdk.client.IngressClient
import dev.restate.sdk.client.RequestOptions
import dev.restate.sdk.common.Serde
import dev.restate.sdk.common.Target
import kotlinx.coroutines.future.await
import kotlin.time.Duration
import kotlin.time.toJavaDuration
import kotlinx.coroutines.future.await

// Extension methods for the IngressClient

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,15 @@ public <Res> CompletableFuture<Res> attachAsync(Serde<Res> resSerde, RequestOpti
handleNonSuccessResponse(response);
}

return null;
try {
return resSerde.deserialize(response.body());
} catch (Exception e) {
throw new IngressException(
"Cannot deserialize the response",
response.statusCode(),
response.body(),
e);
}
});
}

Expand Down Expand Up @@ -224,7 +232,15 @@ public <Res> CompletableFuture<Res> getOutputAsync(
handleNonSuccessResponse(response);
}

return null;
try {
return resSerde.deserialize(response.body());
} catch (Exception e) {
throw new IngressException(
"Cannot deserialize the response",
response.statusCode(),
response.body(),
e);
}
});
}
};
Expand Down

0 comments on commit 1411eff

Please sign in to comment.