error_helpers.h 821 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include <library/cpp/yt/error/error.h>
  3. #include <library/cpp/yt/error/error_attributes.h>
  4. #include <library/cpp/yt/misc/optional.h>
  5. namespace NYT {
  6. // NB: Methods below are listed in a separate file and not in error.h to prevent
  7. // circular includes cause by the fact that attributes include error.
  8. ////////////////////////////////////////////////////////////////////////////////
  9. template <class T>
  10. typename TOptionalTraits<T>::TOptional FindAttribute(const TError& error, TStringBuf key);
  11. template <class T>
  12. typename TOptionalTraits<T>::TOptional FindAttributeRecursive(const TError& error, TStringBuf key);
  13. ////////////////////////////////////////////////////////////////////////////////
  14. } // namespace NYT
  15. #define ERROR_HELPERS_INL_H_
  16. #include "error_helpers-inl.h"
  17. #undef ERROR_HELPERS_INL_H_