+Deprecated::ScriptValue ScriptDebugServer::exceptionOrCaughtValue(JSC::ExecState* state)
+{
+ if (reasonForPause() == PausedForException)
+ return Deprecated::ScriptValue(state->vm(), currentException());
+
+ RefPtr<DebuggerCallFrame> debuggerCallFrame = currentDebuggerCallFrame();
+ while (debuggerCallFrame) {
+ DebuggerScope* scope = debuggerCallFrame->scope();
+ if (scope->isCatchScope())
+ return Deprecated::ScriptValue(state->vm(), scope->caughtValue());
+ debuggerCallFrame = debuggerCallFrame->callerFrame();
+ }