mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-07-26 21:08:45 +08:00
add detail crash info
This commit is contained in:
@@ -20,25 +20,6 @@
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
|
||||
class nasal_err
|
||||
{
|
||||
private:
|
||||
uint32_t error;
|
||||
std::string stage;
|
||||
public:
|
||||
nasal_err(
|
||||
const uint32_t _error,
|
||||
const std::string _stage
|
||||
):error(_error),stage(_stage){}
|
||||
void unwarp(const std::string& error_file)
|
||||
{
|
||||
if(!error)
|
||||
return;
|
||||
std::cout<<"["<<stage<<"] in <"<<error_file<<">: error(s) occurred,stop.\n";
|
||||
std::exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
check if a string can be converted to a number
|
||||
if this string cannot be converted to a number,it will return nan
|
||||
|
||||
Reference in New Issue
Block a user