Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,13 @@ list(APPEND BOSON_DEPENDS
spdlog-setup
nlohmann
libutf8proc
libuv
)

set(LIBS
utf8proc
sqlite3)
sqlite3
uv_a)

if(WIN32)
set(LIBS
Expand Down
2 changes: 1 addition & 1 deletion src/addons/activeproxy/activeproxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

#include "activeproxy.h"
#include "connection.h"
#include "exceptions.h"
#include "exceptions/exceptions.h"
#include "utils/addr.h"
#include "crypto/hex.h"

Expand Down
2 changes: 1 addition & 1 deletion src/addons/activeproxy/connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "connection.h"
#include "activeproxy.h"
#include "packettype.h"
#include "exceptions.h"
#include "exceptions/exceptions.h"
#include "utils/log.h"

namespace boson {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/*
<<<<<<< HEAD:src/addons/activeproxy/exceptions.h
* Copyright (c) 2022 - 2023 trinity-tech.io
* Copyright (c) 2023 - ~ bosonnetwork.io
=======
* Copyright (c) 2022 -2023 trinity-tech.io
>>>>>>> 821f2f0 (dht thread change socket select to libuv (#36)):src/core/exceptions/exceptions.h
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -27,7 +31,6 @@
#include <stdexcept>

namespace boson {
namespace activeproxy {

class networking_error : public std::runtime_error
{
Expand All @@ -49,5 +52,16 @@ class state_error : public std::runtime_error
virtual ~state_error() noexcept = default;
};

} // namespace activeproxy
inline void checkArgument(bool expression, const std::string& errorMessage) {
if (!expression) {
throw std::invalid_argument(errorMessage);
}
}

inline void checkState(bool expression, const std::string& errorMessage) {
if (!expression) {
throw state_error(errorMessage);
}
}

} // namespace boson
Loading