Avoid reference to HandlerMethod class in ServerErrorException
This breaks the package dependency cycle between web.server/web.method and makes ServerErrorException more generally applicable. Includes deprecation of the plain reason constructor variant, in favor of providing a Method or MethodParameter context (which MatrixVariableMethodArgumentResolver does now).
This commit is contained in:
@@ -109,7 +109,7 @@ public class SyncInvocableHandlerMethod extends HandlerMethod {
|
||||
Throwable ex = processor.getError();
|
||||
if (ex != null) {
|
||||
throw (ex instanceof ServerErrorException ? (ServerErrorException) ex :
|
||||
new ServerErrorException("Failed to invoke: " + getShortLogMessage(), this, ex));
|
||||
new ServerErrorException("Failed to invoke: " + getShortLogMessage(), getMethod(), ex));
|
||||
}
|
||||
return processor.peek();
|
||||
}
|
||||
|
||||
@@ -98,7 +98,8 @@ public class MatrixVariableMethodArgumentResolver extends AbstractNamedValueSync
|
||||
String paramType = param.getNestedParameterType().getName();
|
||||
throw new ServerErrorException(
|
||||
"Found more than one match for URI path parameter '" + name +
|
||||
"' for parameter type [" + paramType + "]. Use 'pathVar' attribute to disambiguate.");
|
||||
"' for parameter type [" + paramType + "]. Use 'pathVar' attribute to disambiguate.",
|
||||
param, null);
|
||||
}
|
||||
paramValues.addAll(params.get(name));
|
||||
found = true;
|
||||
|
||||
Reference in New Issue
Block a user