From e06e1d991172fba1e9399f836213cd22ecf4152b Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Fri, 26 Aug 2022 17:21:43 +0800 Subject: [PATCH] Throw error exception properly --- src/webui/webapplication.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/webui/webapplication.cpp b/src/webui/webapplication.cpp index 7865e147b..9bbd4df90 100644 --- a/src/webui/webapplication.cpp +++ b/src/webui/webapplication.cpp @@ -155,11 +155,7 @@ void WebApplication::sendWebUIFile() if (m_isAltUIUsed) { if (!Utils::Fs::isRegularFile(localPath)) - { - status(500, u"Internal Server Error"_qs); - print(tr("Unacceptable file type, only regular file is allowed."), Http::CONTENT_TYPE_TXT); - return; - } + throw InternalServerErrorHTTPError(tr("Unacceptable file type, only regular file is allowed.")); QFileInfo fileInfo {localPath.data()}; while (Path(fileInfo.filePath()) != m_rootFolder)