lookup self error code
| 1872 | |
| 1873 | // lookup self error code |
| 1874 | int Errors::Lookup(bool peek) |
| 1875 | { |
| 1876 | Lock guard(mutex_); |
| 1877 | thr_iterator find = STL::find_if(list_.begin(), list_.end(), |
| 1878 | thr_match()); |
| 1879 | if (find != list_.end()) { |
| 1880 | int ret = find->errorID_; |
| 1881 | if (!peek) |
| 1882 | list_.erase(find); |
| 1883 | return ret; |
| 1884 | } |
| 1885 | else |
| 1886 | return 0; |
| 1887 | } |
| 1888 | |
| 1889 | |
| 1890 | // add a new error code for self |