summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorkyren <kerriganw@gmail.com>2017-05-22 14:24:19 -0400
committerkyren <kerriganw@gmail.com>2017-05-22 14:25:36 -0400
commit5c0f183a52ec65bf0c5422cc849138a457e0a5eb (patch)
tree2e103f819c2ba1e2a83d3fe2e8b09bee77510547 /src/error.rs
parentc0ecc39fc7e065d0219d2efa321729b29b9016ca (diff)
downloadmlua-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.rs11
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 {