Echo Writes Code

errors.cpp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "crucible/core/errors.hpp"

namespace crucible
{
	// Randomness errors
	// -----------------

	constexpr auto randomness_source_unavailable::describe() const -> string
	{
		return "host does not provide a suitable randomness source";
	}

	constexpr auto randomness_source_read_failed::describe() const -> string
	{
		return "failed to read from host randomness source";
	}

	// Demangler errors
	// ----------------

#if CRUCIBLE_PLATFORM_HAS_CXA_DEMANGLE
  auto insufficient_demangle_memory::describe() const -> string
	{
		return "insufficient memory to demangle symbol";
	}

  auto invalid_demangle_arguments::describe() const -> string
	{
		return "::abi::__cxa_demangle() invoked with invalid arguments";
	}

  auto unknown_demangle_error::describe() const -> string
	{
		return "::abi::__cxa_demangle() returned an unrecognized error code";
	}
#endif // CRUCIBLE_PLATFORM_HAS_CXA_DEMANGLE

}