src/Contao/Event/Subscriber.php
public function resolveWidgetErrorMessage(ResolveWidgetErrorMessageEvent $event)
    {
        if (!$this->scopeDeterminator->currentScopeIsBackend()) {
            return;
        }

        $error = $event->getError();

        if ($error instanceof \Exception) {
            $event->setError($error->getMessage());
        } elseif (\is_object($error)) {
            if (\method_exists($error, '__toString')) {
                $event->setError((string) $error);
            } else {
                $event->setError(\sprintf('[%s]', \get_class($error)));
            }
        } elseif (!\is_string($error)) {
            $event->setError(\sprintf('[%s]', \gettype($error)));
        }
    }
public function resolveWidgetErrorMessage(ResolveWidgetErrorMessageEvent $event)
    {
        if (!$this->scopeDeterminator->currentScopeIsBackend()) {
            return;
        }

        $error = $event->getError();

        if ($error instanceof \Exception) {
            $event->setError($error->getMessage());
        } elseif (\is_object($error)) {
            if (\method_exists($error, '__toString')) {
                $event->setError((string) $error);
            } else {
                $event->setError(\sprintf('[%s]', \get_class($error)));
            }
        } elseif (!\is_string($error)) {
            $event->setError(\sprintf('[%s]', \gettype($error)));
        }
    }
public function resolveWidgetErrorMessage ( ResolveWidgetErrorMessageEvent $ event ) { if ( ! $ this -> scopeDeterminator -> currentScopeIsBackend ( ) ) { return ; } $ error = $ event -> getError ( ) ; if ( $ error instanceof \ Exception ) { $ event -> setError ( $ error -> getMessage ( ) ) ; } elseif ( \ is_object ( $ error ) ) { if ( \ method_exists ( $ error , '__toString' ) ) { $ event -> setError ( ( string ) $ error ) ; } else { $ event -> setError ( \ sprintf ( '[%s]' , \ get_class ( $ error ) ) ) ; } } elseif ( ! \ is_string ( $ error ) ) { $ event -> setError ( \ sprintf ( '[%s]' , \ gettype ( $ error ) ) ) ; } }
Resolve a widget error message.

@param ResolveWidgetErrorMessageEvent $event The event being processed.

@return void
Resolve a widget error message .