| 185 | } |
| 186 | |
| 187 | Value CatchErrorMessage(const CallbackInfo& info) { |
| 188 | Function thrower = info[0].As<Function>(); |
| 189 | try { |
| 190 | thrower({}); |
| 191 | } catch (const Error& e) { |
| 192 | std::string message = e.Message(); |
| 193 | return String::New(info.Env(), message); |
| 194 | } |
| 195 | return info.Env().Null(); |
| 196 | } |
| 197 | |
| 198 | void CatchAndRethrowError(const CallbackInfo& info) { |
| 199 | Function thrower = info[0].As<Function>(); |