Scaffolding  0.1
This program can assemble genome scaffolds using the pairing information in paired-end reads.
exceptions.hpp
Go to the documentation of this file.
1 
7 #ifndef EXCEPTIONS_HPP
8 #define EXCEPTIONS_HPP
9 
10 #include <string>
11 #include <exception>
12 #include "utils/utils.hpp"
13 
14 namespace except {
15 
17  struct info_not_up_to_date: public std::exception
18  {
19  const std::string which_info;
20  info_not_up_to_date(const std::string _which_info = "unknown info"):
21  which_info(_which_info + " not up to date") {};
22 
23  const char* what() const throw() {
24  return which_info.c_str();
25  }
26  };
27 
29 
30  struct invalid_assumption: public std::exception
31  {
32  const std::string which;
33  invalid_assumption(const std::string _which): which(_which) {};
34 
35  const char* what() const throw() {
36  return which.c_str();
37  }
38  };
39 
42  using invalid_assumption::invalid_assumption;
43  };
44 
46  struct read_error: public std::exception {
47  const unsigned line_no;
48  const std::string errmsg;
49 
50  read_error(const unsigned _line_no, const std::string& _errmsg):
51  line_no(_line_no), errmsg(_errmsg) {}
52  const char* what() const noexcept { return errmsg.c_str(); }
53  };
54 
56  struct bad_syntax: public read_error {
57  using read_error::read_error;
58  };
59 
60 }// namespace
61 
62 #endif
an exception for the case that a given file does not conform to expected syntax
Definition: exceptions.hpp:56
Definition: exceptions.hpp:14
const std::string errmsg
store the error string
Definition: exceptions.hpp:48
an exception for the case that a given file could not be read on a low level
Definition: exceptions.hpp:46
an exception for the case that the given program options are not valid
Definition: exceptions.hpp:41
an exception for the case that a graph property is read that is not up to date
Definition: exceptions.hpp:17
an exception for the case that some assumption that is made is not true
Definition: exceptions.hpp:30
const unsigned line_no
store the line number on which the exception ocurred
Definition: exceptions.hpp:47