errors.hh 463 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

#include <dune/common/exceptions.hh>

/**
 * \file
 * \brief Macro for wrapping error checks and throwing exceptions
 */

namespace Dune {

class VtkError : public Exception {};

}

/**
 * \brief check if condition \a cond holds; otherwise, throw a VtkError.
 */
#define VTK_ASSERT(cond, text)          \
  do {                                  \
    if (!(cond))                        \
      DUNE_THROW(Dune::VtkError, text); \
  } while (false)