UserInputException via AJAX is now properly handled
authorAlexander Ebert <ebert@woltlab.com>
Tue, 28 Aug 2012 15:21:49 +0000 (17:21 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 28 Aug 2012 15:21:49 +0000 (17:21 +0200)
wcfsetup/install/files/lib/action/AJAXProxyAction.class.php
wcfsetup/install/files/lib/system/exception/UserInputException.class.php

index 8163a7091c2c226dfe17d7ced680120af4eefc99..fab13a263d38763f185b36320060e57b0bdeef2b 100644 (file)
@@ -155,7 +155,7 @@ class AJAXProxyAction extends AbstractSecureAction {
                        throw new AJAXException($e->getMessage(), AJAXException::INTERNAL_ERROR, $e->__getTraceAsString());
                }
                else if ($e instanceof UserInputException) {
-                       throw new AJAXException($e->getMessage(), AJAXException::BAD_PARAMETERS);
+                       throw new AJAXException($e->getMessage(), AJAXException::BAD_PARAMETERS, $e->getTraceAsString());
                }
                else {
                        throw new AJAXException($e->getMessage(), AJAXException::INTERNAL_ERROR, $e->getTraceAsString());
index 0b93eab51213c1d770d58cdbf5cb264406de36dd..072c09415c58db789d588c556e3147898941febf 100644 (file)
@@ -35,6 +35,7 @@ class UserInputException extends UserException {
        public function __construct($field = '', $type = 'empty') {
                $this->field = $field;
                $this->type = $type;
+               $this->message = 'Parameter '.$field.' is missing or invalid';
                
                parent::__construct();
        }