forked from x-infra-lab/x-remoting
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle UserProcessor throw Exception (x-infra-lab#26)
- Loading branch information
Showing
9 changed files
with
57 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/test/java/io/github/xinfra/lab/remoting/rpc/client/ExceptionProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.github.xinfra.lab.remoting.rpc.client; | ||
|
||
import io.github.xinfra.lab.remoting.processor.UserProcessor; | ||
|
||
public class ExceptionProcessor implements UserProcessor<ExceptionRequest> { | ||
|
||
@Override | ||
public String interest() { | ||
return ExceptionRequest.class.getName(); | ||
} | ||
|
||
@Override | ||
public Object handRequest(ExceptionRequest request) { | ||
throw new RuntimeException(request.getErrorMsg()); | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
src/test/java/io/github/xinfra/lab/remoting/rpc/client/ExceptionRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.github.xinfra.lab.remoting.rpc.client; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.io.Serializable; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ExceptionRequest implements Serializable { | ||
|
||
private String errorMsg; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 0 additions & 63 deletions
63
src/test/java/io/github/xinfra/lab/remoting/rpc/client/RpcTest.java
This file was deleted.
Oops, something went wrong.