07-31-2013, 10:44 PM
I am trying to port Hime's Full Error Backtrace script to RPGmXP (this one)
It works fine as is (as long as you have that recently posts Console script) except that I get things like "Section086" instead of "Game_Player" so I can assume it is stored in a different place in scripts.rxdata.
here is the code if it helps (add it into the Main method)
It works fine as is (as long as you have that recently posts Console script) except that I get things like "Section086" instead of "Game_Player" so I can assume it is stored in a different place in scripts.rxdata.
here is the code if it helps (add it into the Main method)
Code:
rescue Exception => error #Exception => error
scripts_name = load_data('Data/Scripts.rxdata')
scripts_name.collect! {|script| script[1] }
backtrace = []
error.backtrace.each_with_index {|line,i|
if line =~ /{(.*)}(.*)/
backtrace << (scripts_name[$1.to_i] + $2)
elsif line =~ /\A:1:/
break
else
backtrace << line
end
}
error_line = backtrace.first
backtrace[0] = ''
out_string = error_line + ": " + error.message + " (#{error.class})" + backtrace.join("\n\tfrom ") + "\n"
console.log( out_string)
raise error.class, "Error ocurred, check the debug console for more information.", [error.backtrace.first]