https://mooseframework.inl.gov
Public Member Functions | Private Attributes | List of all members
Moose::ScopedThrowOnError Class Reference

Scoped helper for setting Moose::_throw_on_error during this scope. More...

#include <Moose.h>

Public Member Functions

 ScopedThrowOnError ()
 Default constructor, which sets Moose::_throw_on_error = true. More...
 
 ScopedThrowOnError (const bool throw_on_error)
 Specialized constructor, which sets Moose::_throw_on_error based on the argument throw_on_error. More...
 
 ~ScopedThrowOnError ()
 Destructor, which sets Moose::_throw_on_error to what it was upon construction. More...
 

Private Attributes

const bool _throw_on_error_before
 The value of Moose::_throw_on_error at construction. More...
 

Detailed Description

Scoped helper for setting Moose::_throw_on_error during this scope.

Cannot be used within threads.

Definition at line 294 of file Moose.h.

Constructor & Destructor Documentation

◆ ScopedThrowOnError() [1/2]

Moose::ScopedThrowOnError::ScopedThrowOnError ( )

Default constructor, which sets Moose::_throw_on_error = true.

Definition at line 773 of file Moose.C.

773 : ScopedThrowOnError(true) {}
ScopedThrowOnError()
Default constructor, which sets Moose::_throw_on_error = true.
Definition: Moose.C:773

◆ ScopedThrowOnError() [2/2]

Moose::ScopedThrowOnError::ScopedThrowOnError ( const bool  throw_on_error)

Specialized constructor, which sets Moose::_throw_on_error based on the argument throw_on_error.

Definition at line 766 of file Moose.C.

768 {
769  mooseAssert(!libMesh::Threads::in_threads, "Cannot be used in threads");
770  Moose::_throw_on_error = throw_on_error;
771 }
const bool _throw_on_error_before
The value of Moose::_throw_on_error at construction.
Definition: Moose.h:316
bool _throw_on_error
Variable to turn on exceptions during mooseError(), should only be used within MOOSE unit tests or wh...
Definition: Moose.C:791

◆ ~ScopedThrowOnError()

Moose::ScopedThrowOnError::~ScopedThrowOnError ( )

Destructor, which sets Moose::_throw_on_error to what it was upon construction.

Definition at line 775 of file Moose.C.

const bool _throw_on_error_before
The value of Moose::_throw_on_error at construction.
Definition: Moose.h:316
bool _throw_on_error
Variable to turn on exceptions during mooseError(), should only be used within MOOSE unit tests or wh...
Definition: Moose.C:791

Member Data Documentation

◆ _throw_on_error_before

const bool Moose::ScopedThrowOnError::_throw_on_error_before
private

The value of Moose::_throw_on_error at construction.

Definition at line 316 of file Moose.h.

Referenced by ~ScopedThrowOnError().


The documentation for this class was generated from the following files: