-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
33 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use jni::JNIEnv; | ||
|
||
pub fn throw_runtime_exception<T: AsRef<str>>(env: &mut JNIEnv, message: T) { | ||
let _ = env.throw(("java/lang/RuntimeException", message)); | ||
} | ||
|
||
pub fn throw_illegal_state_exception<T: AsRef<str>>(env: &mut JNIEnv, message: T) { | ||
let _ = env.throw(("java/lang/IllegalStateException", message)); | ||
} | ||
|
||
pub fn throw_io_exception<T: AsRef<str>>(env: &mut JNIEnv, message: T) { | ||
let _ = env.throw(("java/io/IOException", message)); | ||
} | ||
|
||
pub fn throw_illegal_argument_exception<T: AsRef<str>>(env: &mut JNIEnv, message: T) { | ||
let _ = env.throw(("java/lang/IllegalArgumentException", message)); | ||
} |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod encoder; | ||
pub mod decoder; | ||
mod exceptions; |
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