Put error_state into into it's own file.
This commit is contained in:
19
base/error_state.cc
Normal file
19
base/error_state.cc
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "base/error_state.h"
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
base::error_state
|
||||
base::combine_errors(error_state lhs, error_state rhs) {
|
||||
switch (lhs) {
|
||||
case NO_ERROR:
|
||||
return rhs;
|
||||
|
||||
case NON_FATAL:
|
||||
return (rhs == FATAL) ? FATAL : lhs;
|
||||
|
||||
default:
|
||||
return lhs;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
18
base/error_state.h
Normal file
18
base/error_state.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef BASE_ERROR_STATE_H
|
||||
#define BASE_ERROR_STATE_H
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
namespace base {
|
||||
enum error_state {
|
||||
NO_ERROR,
|
||||
NON_FATAL, // eg, lost blocks
|
||||
FATAL // needs fixing before pool can be activated
|
||||
};
|
||||
|
||||
error_state combine_errors(error_state lhs, error_state rhs);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user