source: SMSSender/lib/libdatatypes/src/exceptions/httpexceptions.h @ 72:fc91522ef9be

3.0
Last change on this file since 72:fc91522ef9be was 72:fc91522ef9be, checked in by Sämy Zehnder <saemy.zehnder@…>, 8 years ago
  • Started exception handling
  • Fixed several bugs from the removal of the iloginaccount gateway
File size: 895 bytes
Line 
1/*
2 * HttpExceptions.h
3 *
4 *  Created on: Jan 4, 2010
5 *      Author: saemy
6 */
7
8
9#include "eexception.h"
10
11#include <QList>
12#include <QSslError>
13
14namespace Http {
15    class EReadException: public EException {
16    public:
17        explicit EReadException(const QString& msg) : EException(msg) {}
18    };
19
20    class ESSLException: public EException {
21    public:
22        explicit ESSLException(const QList<QSslError>& errors)
23            : EException("")
24            , errors_(errors)
25        {
26            QString errorMsg = QObject::tr("SSL-Errors: ");
27            foreach (QSslError error, errors) {
28                errorMsg += error.errorString() + '\n';
29            }
30            errorMsg.left(errorMsg.length()-1);
31
32            EException::setMessage(errorMsg);
33        }
34
35        QList<QSslError> sslErrors() const { return errors_; }
36
37    private:
38        QList<QSslError> errors_;
39    };
40}
Note: See TracBrowser for help on using the repository browser.