|
|
@@ -26,7 +26,6 @@ import (
|
|
|
std_errors "errors"
|
|
|
"net"
|
|
|
"regexp"
|
|
|
- "runtime/debug"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
@@ -104,21 +103,6 @@ func dispatchAPIRequestHandler(
|
|
|
name string,
|
|
|
params common.APIParameters) (response []byte, reterr error) {
|
|
|
|
|
|
- // Recover from and log any unexpected panics caused by user input
|
|
|
- // handling bugs. User inputs should be properly validated; this
|
|
|
- // mechanism is only a last resort to prevent the process from
|
|
|
- // terminating in the case of a bug.
|
|
|
- defer func() {
|
|
|
- if e := recover(); e != nil {
|
|
|
- if intentionalPanic, ok := e.(IntentionalPanicError); ok {
|
|
|
- panic(intentionalPanic)
|
|
|
- } else {
|
|
|
- log.LogPanicRecover(e, debug.Stack())
|
|
|
- reterr = errors.TraceNew("request handler panic")
|
|
|
- }
|
|
|
- }
|
|
|
- }()
|
|
|
-
|
|
|
// Before invoking the handlers, enforce some preconditions:
|
|
|
//
|
|
|
// - A handshake request must precede any other requests.
|