Skip to content

Commit 4bb4ba9

Browse files
author
Chrono Law
committed
exception msg
1 parent b0ed8e8 commit 4bb4ba9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ngxpp/NgxException.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,30 @@ class NgxException final : public virtual std::exception,
3939
throw NgxException(rc, msg);
4040
}
4141

42-
static void require(bool cond, ngx_int_t e = NGX_ERROR)
42+
static void require(bool cond, ngx_int_t e = NGX_ERROR, string_ref_type msg = "")
4343
{
4444
if(!cond)
4545
{
46-
raise(e);
46+
raise(e, msg);
4747
}
4848
}
4949

50-
static void require(ngx_int_t rc, ngx_int_t x = NGX_OK)
50+
static void require(ngx_int_t rc, ngx_int_t x = NGX_OK, string_ref_type msg = "")
5151
{
52-
require(rc == x, rc);
52+
require(rc == x, rc, msg);
5353
}
5454

5555
template<typename T>
56-
static void require(T* p, ngx_int_t e = NGX_ERROR)
56+
static void require(T* p, ngx_int_t e = NGX_ERROR, string_ref_type msg = "")
5757
{
58-
require(p != nullptr, e);
58+
require(p != nullptr, e, msg);
5959
}
6060

61-
static void fail(bool cond, ngx_int_t e = NGX_ERROR)
61+
static void fail(bool cond, ngx_int_t e = NGX_ERROR, string_ref_type msg = "")
6262
{
6363
if(cond)
6464
{
65-
raise(e);
65+
raise(e, msg);
6666
}
6767
}
6868

0 commit comments

Comments
 (0)