Use more suitable exception
authorAlexander Ebert <ebert@woltlab.com>
Fri, 22 Dec 2017 10:33:49 +0000 (11:33 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 22 Dec 2017 10:33:49 +0000 (11:33 +0100)
wcfsetup/install/files/lib/data/user/UserProfile.class.php

index a4724595deef98fdd3f60686af7f93c7ff1729c5..3cd64237d9873f3e2529142a148448aac03a46ec 100644 (file)
@@ -19,6 +19,7 @@ use wcf\system\cache\builder\UserGroupPermissionCacheBuilder;
 use wcf\system\cache\runtime\UserProfileRuntimeCache;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\event\EventHandler;
+use wcf\system\exception\ImplementationException;
 use wcf\system\user\signature\SignatureCache;
 use wcf\system\user\storage\UserStorageHandler;
 use wcf\system\WCF;
@@ -276,7 +277,7 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject {
                                                
                                                if ($parameters['avatar'] !== null) {
                                                        if (!($parameters['avatar'] instanceof IUserAvatar)) {
-                                                               throw new \RuntimeException("Object '".get_class($parameters['avatar'])."' does not implement '".IUserAvatar::class."'.");
+                                                               throw new ImplementationException(get_class($parameters['avatar']), IUserAvatar::class);
                                                        }
                                                        
                                                        $this->avatar = $parameters['avatar'];