code: private int getErrorCode(Object error) {
          if (error instanceof Number) {
              return ((Number) error).intValue();
          } else if (error instanceof YokeException) {
              return ((YokeException) error).getErrorCode().intValue();
          } else if (error instanceof JsonObject) {
              return ((JsonObject) error).getInteger("errorCode", 500);
          } else if (error instanceof Map) {
              Integer tmp = (Integer) ((Map) error).get("errorCode");
              return tmp != null ? tmp : 500;
          } else {
              return 500;
          }
      }
docs: Extracts a single error code from a error Object. This will handle Throwables, Strings and Numbers.
  
  @param error Error object
  @return HTTP status code for the error object