Ecommerce C++  1.0
Trabalho Prático PDS2 | UFMG
exceptions.hpp
1 #ifndef _EXCEPTION_HPP_
2 #define _EXCEPTION_HPP_
3 
4 #include "autoload.hpp"
5 
6 class UsuarioExistenteException : public std::exception
7 {
8  private:
9  std::string msg = "Erro: Não foi possível criar o usuário. Usuário já existe.";
10  public:
11  virtual const char* what() const throw()
12  {
13  return msg.c_str();
14  }
15 };
16 
17 class UsuarioNaoEncontradoException : public std::exception
18 {
19  private:
20  std::string msg = "Erro: Não foi possível encontrar o usuário.";
21  public:
22  virtual const char* what() const throw()
23  {
24  return msg.c_str();
25  }
26 };
27 
28 class UsuarioSenhaInvalidaException : public std::exception
29 {
30  private:
31  std::string msg = "Erro: Senha inválida.";
32  public:
33  virtual const char* what() const throw()
34  {
35  return msg.c_str();
36  }
37 };
38 
39 #endif
Definition: exceptions.hpp:7
Definition: exceptions.hpp:18
Definition: exceptions.hpp:29