lib/xgb/utils.rb in xgb-0.1.0 vs lib/xgb/utils.rb in xgb-0.1.1

- old
+ new

@@ -1,9 +1,13 @@ module Xgb module Utils private def check_result(err) - raise Xgb::Error, FFI.XGBGetLastError if err != 0 + if err != 0 + # make friendly + message = FFI.XGBGetLastError.split("\n").first.split(/:\d+: /, 2).last + raise Xgb::Error, message + end end end end