diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2018-02-20 16:56:51 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2018-02-20 16:58:24 -0800 |
| commit | 99092990398ab80484cced0927e55bedfda05077 (patch) | |
| tree | a2fd0ed88d5de25f3200432405c9304ad1013bb3 /toolsrc/include | |
| parent | 2f6cf768e54a155c282a7b490027ceb7be245fbf (diff) | |
| download | vcpkg-99092990398ab80484cced0927e55bedfda05077.tar.gz vcpkg-99092990398ab80484cced0927e55bedfda05077.zip | |
Expected::check_exit() now always shows line_info if it fails
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg/base/expected.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/toolsrc/include/vcpkg/base/expected.h b/toolsrc/include/vcpkg/base/expected.h index b3b81ae81..1f3d94638 100644 --- a/toolsrc/include/vcpkg/base/expected.h +++ b/toolsrc/include/vcpkg/base/expected.h @@ -103,7 +103,12 @@ namespace vcpkg private: void exit_if_error(const LineInfo& line_info) const { - Checks::check_exit(line_info, !m_s.has_error(), m_s.to_string()); + // This is used for quick value_or_exit() calls, so always put line_info in the error message. + Checks::check_exit(line_info, + !m_s.has_error(), + "Failed at [%s] with message:\n%s", + line_info.to_string(), + m_s.to_string()); } ErrorHolder<S> m_s; |
