Commit c278f9d2 authored by jan.koester's avatar jan.koester
Browse files

test

parent a0c57784
Loading
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@
#include "favicon.h"

#include <json-c/json.h>
#include <netplus/exception.h>

#ifndef _WIN32
#include <unistd.h>
@@ -773,9 +774,14 @@ int main(int argc,char *argv[]){
            pluginThreads.emplace_back([&lp, &pname](){
                try {
                    lp.instance->run();
                } catch(const netplus::NetException &e) {
                    std::cerr << "Plugin '" << pname << "' net error: "
                              << e.what() << std::endl;
                } catch(const std::exception &e) {
                    std::cerr << "Plugin '" << pname << "' error: "
                              << e.what() << std::endl;
                } catch(...) {
                    std::cerr << "Plugin '" << pname << "' unknown error" << std::endl;
                }
            });
            pluginThreads.back().detach();
@@ -790,10 +796,14 @@ int main(int argc,char *argv[]){
        authdb::g_KdcPlugin = nullptr;
        authdb::g_AdPlugin  = nullptr;
        authdb::g_PluginManager = nullptr;
    }catch(const netplus::NetException &e){
        std::cerr << "NetException: " << e.what() << std::endl;
    }catch(authdb::AuthBackendError &e){
        std::cerr << e.what() << std::endl;
    }catch(std::exception &e){
        std::cerr << e.what() << std::endl;
    }catch(...){
        std::cerr << "Unknown fatal exception" << std::endl;
    }
    return 0;
}
+9 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#include <iostream>
#include <filesystem>
#include <cstring>
#include <netplus/exception.h>

#ifdef Windows
#  include <windows.h>
@@ -161,6 +162,11 @@ int PluginManager::loadAll(const std::string &directory,
        Plugin *instance = nullptr;
        try {
            instance = createFn(backend, configJson);
        } catch (const netplus::NetException &e) {
            std::cerr << "Plugin create failed: " << fname << ": "
                      << e.what() << std::endl;
            pluginClose(handle);
            continue;
        } catch (const std::exception &e) {
            std::cerr << "Plugin create failed: " << fname << ": "
                      << e.what() << std::endl;
@@ -193,6 +199,9 @@ void PluginManager::initAll() {
        if (lp.instance) {
            try {
                lp.instance->init();
            } catch (const netplus::NetException &e) {
                std::cerr << "Plugin init failed: " << name << ": "
                          << e.what() << std::endl;
            } catch (const std::exception &e) {
                std::cerr << "Plugin init failed: " << name << ": "
                          << e.what() << std::endl;