Skip to content

Commit

Permalink
fix #126: bad Exception being used with C4_ERROR_THROWS_EXCEPTION
Browse files Browse the repository at this point in the history
  • Loading branch information
biojppm committed Apr 19, 2024
1 parent 1f7f457 commit 4d4d0fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelog/current.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ assert(to_substr((char*)ptr).len == 3); // as before
### Fixes
- Fix [#126](https://github.com/biojppm/c4core/issues/126): bad `Exception` being used with `C4_ERROR_THROWS_EXCEPTION`.
- [PR#132](https://github.com/biojppm/c4core/pull/132):
- Fix typo `C_4MSVC_VERSION_2019` in `src/compiler.hpp` ([#124](https://github.com/biojppm/c4core/issues/124)).
- Add check for definition of `__GNUC__` in `gcc-4.8.hpp` ([#125](https://github.com/biojppm/c4core/issues/125)).
Expand All @@ -73,3 +74,4 @@ assert(to_substr((char*)ptr).len == 3); // as before
### Thanks
- @zangruochen
- @yrHeTaTeJlb
2 changes: 1 addition & 1 deletion src/c4/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void handle_error(srcloc where, const char *fmt, ...)
if(s_error_flags & ON_ERROR_THROW)
{
#if defined(C4_EXCEPTIONS_ENABLED) && defined(C4_ERROR_THROWS_EXCEPTION)
throw Exception(buf);
throw std::runtime_error(buf);
#else
abort();
#endif
Expand Down

0 comments on commit 4d4d0fd

Please sign in to comment.