source: SMSSender/lib/libdatatypes/src/exceptions/httpexceptions.h @ 73:85d8decd3656

3.0
Last change on this file since 73:85d8decd3656 was 73:85d8decd3656, checked in by Sämy Zehnder <saemy.zehnder@…>, 9 years ago
  • Backupversion only! Before removal of QObject as parent of EException
File size: 937 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::setWhat(errorMsg);
33        }
34        virtual ~ESSLException() throw() {};
35
36        QList<QSslError> sslErrors() const { return errors_; }
37
38    private:
39        QList<QSslError> errors_;
40    };
41}
Note: See TracBrowser for help on using the repository browser.