Commit 854b6af 1 parent cdd3507 commit 854b6af Copy full SHA for 854b6af
File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -102,12 +102,18 @@ class Branch {
102
102
103
103
/* Checks are used very often */
104
104
inline void CheckFrozen (bool expected = true ) const {
105
- if (is_frozen_ != expected)
106
- throw std::runtime_error (" Branch is frozen" );
105
+ if (is_frozen_ != expected) {
106
+ const std::string prefix = expected ? " un" : " " ;
107
+ const std::string message = " Branch " + config_.GetName () + " is " + prefix + " frozen while the opposite was expected" ;
108
+ throw std::runtime_error (message);
109
+ }
107
110
}
108
111
inline void CheckMutable (bool expected = true ) const {
109
- if (is_mutable_ != expected)
110
- throw std::runtime_error (" Branch is not mutable" );
112
+ if (is_mutable_ != expected) {
113
+ const std::string prefix = expected ? " im" : " " ;
114
+ const std::string message = " Branch " + config_.GetName () + " is " + prefix + " mutable while the opposite was expected" ;
115
+ throw std::runtime_error (message);
116
+ }
111
117
}
112
118
/* *
113
119
* @brief Gets variables according to variable names specified in the arguments.
You can’t perform that action at this time.
0 commit comments