diff options
author | kyren <kerriganw@gmail.com> | 2017-05-22 14:24:19 -0400 |
---|---|---|
committer | kyren <kerriganw@gmail.com> | 2017-05-22 14:25:36 -0400 |
commit | 5c0f183a52ec65bf0c5422cc849138a457e0a5eb (patch) | |
tree | 2e103f819c2ba1e2a83d3fe2e8b09bee77510547 /src/error.rs | |
parent | c0ecc39fc7e065d0219d2efa321729b29b9016ca (diff) | |
download | mlua-5c0f183a52ec65bf0c5422cc849138a457e0a5eb.zip |
Improved error handling and formatting
Now prints lua backtraces on callback errors as well. This could be
controlled with LUA_BACKTRACE or just RUST_BACKTRACE or similar.
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/error.rs b/src/error.rs index a5c2ed8..490e1c6 100644 --- a/src/error.rs +++ b/src/error.rs @@ -30,8 +30,15 @@ error_chain! { } errors { - ScriptError(err: String) - IncompleteStatement(err: String) + ScriptError(err: String) { + display("Error executing lua script {}", err) + } + CallbackError(err: String) { + display("Error during lua callback {}", err) + } + IncompleteStatement(err: String) { + display("Incomplete lua statement {}", err) + } } foreign_links { |