diff --git a/src/app/external/alfresco/controllers/AlfrescoController.php b/src/app/external/alfresco/controllers/AlfrescoController.php
index f20a644eca498ac1c4993eb3dd71d546e2217f7c..70bcec45601567bb8708d9d1247ab3e70799732f 100644
--- a/src/app/external/alfresco/controllers/AlfrescoController.php
+++ b/src/app/external/alfresco/controllers/AlfrescoController.php
@@ -330,10 +330,10 @@ class AlfrescoController
         }
 
         if ($curlResponse['code'] != 200) {
-            if ($curlResponse['code'] == 404) {
-                return $response->withStatus(400)->withJson(['errors' => 'Page not found', 'lang' => 'pageNotFound']);
-            } elseif (!empty($curlResponse['response']['error']['briefSummary'])) {
+            if (!empty($curlResponse['response']['error']['briefSummary'])) {
                 return $response->withStatus(400)->withJson(['errors' => $curlResponse['response']['error']['briefSummary']]);
+            } elseif ($curlResponse['code'] == 404) {
+                return $response->withStatus(400)->withJson(['errors' => 'Page not found', 'lang' => 'pageNotFound']);
             } else {
                 return $response->withStatus(400)->withJson(['errors' => json_encode($curlResponse['response'])]);
             }