diff --git a/lib/SimpleSAML/Error/Exception.php b/lib/SimpleSAML/Error/Exception.php
index 516643ff81074a9a17f96bbcb3b2d0bbd05fd08d..90e1b881f336900d971587591328b2a9665e7cda 100644
--- a/lib/SimpleSAML/Error/Exception.php
+++ b/lib/SimpleSAML/Error/Exception.php
@@ -64,9 +64,9 @@ class Exception extends \Exception
      *
      * @param \Exception $e The exception.
      *
-     * @return \Exception The new exception.
+     * @return \SimpleSAML\Error\Exception The new exception.
      */
-    public static function fromException(\Exception $e): \Exception
+    public static function fromException(\Exception $e): Exception
     {
         if ($e instanceof Exception) {
             return $e;