Unverified Commit 18976dc0 authored by Dennis Jenkins's avatar Dennis Jenkins Committed by GitHub

Merge pull request #316 from knowledge4igor/improve_debug_info

Add printing file name and line number in TRY and TRY_RET 
parents 2db95183 0a40d841
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
} else { \ } else { \
oss << strerror(errno); \ oss << strerror(errno); \
} \ } \
oss << " (" << __FILE__ << ":" << __LINE__ << ")"; \
throw std::runtime_error(oss.str()); \ throw std::runtime_error(oss.str()); \
} \ } \
} while (0) } while (0)
...@@ -41,6 +42,7 @@ ...@@ -41,6 +42,7 @@
const char *str = #__VA_ARGS__; \ const char *str = #__VA_ARGS__; \
std::ostringstream oss; \ std::ostringstream oss; \
oss << str << ": " << strerror(errno); \ oss << str << ": " << strerror(errno); \
oss << " (" << __FILE__ << ":" << __LINE__ << ")"; \
throw std::runtime_error(oss.str()); \ throw std::runtime_error(oss.str()); \
} \ } \
return ret; \ return ret; \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment