Skip to content

Commit

Permalink
Don't try to handle Error (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
slinkydeveloper authored Sep 9, 2024
1 parent b28f7da commit dea6bae
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ internal class ContextImpl internal constructor(private val syscalls: Syscalls)
actionReturnValue = block()
} catch (e: TerminalException) {
actionFailure = e
} catch (e: Error) {
throw e
} catch (t: Throwable) {
syscalls.fail(t)
throw CancellationException("Side effect failure", t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ internal constructor(
val req: REQ
try {
req = handlerSpecification.requestSerde.deserialize(syscalls.request().bodyBuffer())
} catch (e: Error) {
throw e
} catch (e: Throwable) {
LOG.warn("Error when deserializing input", e)
throw TerminalException(
Expand All @@ -77,8 +75,6 @@ internal constructor(
// Serialize output
try {
serializedResult = handlerSpecification.responseSerde.serializeToByteBuffer(res)
} catch (e: Error) {
throw e
} catch (e: Throwable) {
LOG.warn("Error when serializing input", e)
throw TerminalException(
Expand Down
2 changes: 0 additions & 2 deletions sdk-api/src/main/java/dev/restate/sdk/ContextImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ public void onCancel(@Nullable Throwable t) {
res = action.get();
} catch (TerminalException e) {
failure = e;
} catch (Error e) {
throw e;
} catch (Throwable e) {
syscalls.fail(e);
AbortedExecutionException.sneakyThrow();
Expand Down
6 changes: 0 additions & 6 deletions sdk-api/src/main/java/dev/restate/sdk/HandlerRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ public void run(
try {
req =
handlerSpecification.getRequestSerde().deserialize(syscalls.request().bodyBuffer());
} catch (Error e) {
throw e;
} catch (Throwable e) {
LOG.warn("Cannot deserialize input", e);
callback.onCancel(
Expand All @@ -84,8 +82,6 @@ public void run(
RES res;
try {
res = this.runner.apply(ctx, req);
} catch (Error e) {
throw e;
} catch (Throwable e) {
callback.onCancel(e);
return;
Expand All @@ -95,8 +91,6 @@ public void run(
ByteBuffer serializedResult;
try {
serializedResult = handlerSpecification.getResponseSerde().serializeToByteBuffer(res);
} catch (Error e) {
throw e;
} catch (Throwable e) {
LOG.warn("Cannot serialize output", e);
callback.onCancel(
Expand Down

0 comments on commit dea6bae

Please sign in to comment.