mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 12:37:09 +08:00
修复编译错误
This commit is contained in:
parent
056ce72182
commit
7431a05811
@ -7,7 +7,9 @@
|
|||||||
#include "Util/logger.h"
|
#include "Util/logger.h"
|
||||||
#include "Util/onceToken.h"
|
#include "Util/onceToken.h"
|
||||||
#include "Util/NoticeCenter.h"
|
#include "Util/NoticeCenter.h"
|
||||||
|
#ifdef ENABLE_MYSQL
|
||||||
#include "Util/SqlPool.h"
|
#include "Util/SqlPool.h"
|
||||||
|
#endif //ENABLE_MYSQL
|
||||||
#include "Common/config.h"
|
#include "Common/config.h"
|
||||||
#include "Common/MediaSource.h"
|
#include "Common/MediaSource.h"
|
||||||
#include "Http/HttpRequester.h"
|
#include "Http/HttpRequester.h"
|
||||||
@ -161,12 +163,16 @@ static inline void addHttpListener(){
|
|||||||
val["code"] = ex.code();
|
val["code"] = ex.code();
|
||||||
val["msg"] = ex.what();
|
val["msg"] = ex.what();
|
||||||
invoker("200 OK", headerOut, val.toStyledString());
|
invoker("200 OK", headerOut, val.toStyledString());
|
||||||
} catch(SqlException &ex){
|
}
|
||||||
|
#ifdef ENABLE_MYSQL
|
||||||
|
catch(SqlException &ex){
|
||||||
val["code"] = API::SqlFailed;
|
val["code"] = API::SqlFailed;
|
||||||
val["msg"] = StrPrinter << "操作数据库失败:" << ex.what() << ":" << ex.getSql();
|
val["msg"] = StrPrinter << "操作数据库失败:" << ex.what() << ":" << ex.getSql();
|
||||||
WarnL << ex.what() << ":" << ex.getSql();
|
WarnL << ex.what() << ":" << ex.getSql();
|
||||||
invoker("200 OK", headerOut, val.toStyledString());
|
invoker("200 OK", headerOut, val.toStyledString());
|
||||||
} catch (std::exception &ex) {
|
}
|
||||||
|
#endif// ENABLE_MYSQL
|
||||||
|
catch (std::exception &ex) {
|
||||||
val["code"] = API::OtherFailed;
|
val["code"] = API::OtherFailed;
|
||||||
val["msg"] = ex.what();
|
val["msg"] = ex.what();
|
||||||
invoker("200 OK", headerOut, val.toStyledString());
|
invoker("200 OK", headerOut, val.toStyledString());
|
||||||
|
Loading…
Reference in New Issue
Block a user