summaryrefslogtreecommitdiffstats
path: root/testing-client
Commit message (Expand)AuthorAgeFilesLines
* ignore bintest directoriesacolyer2005-05-311-0/+1
* newbuild.xml replacing build.xml, with Alex okwisberg2005-05-192-38/+3
* prospective replacements for {module}/build.xml - will move there once valida...wisberg2005-05-111-0/+6
* LTW modules + AntSpec to test LTW in the sandbox + code cleanup in my FIXME +...avasseur2005-05-041-1/+5
* From branch: New build scripts that Alex uses under IntelliJ - can be run ind...aclement2005-04-191-0/+35
* spring cleaning in advance of 1.2 enhancements: acolyer2004-01-231-1/+1
* Ignore bin directoryacolyer2003-02-261-0/+1
* resolving unused-imports warningswisberg2003-02-131-2/+1
* minor Tester API tests brought down from atticwisberg2002-12-303-2/+268
* initial versionwisberg2002-12-165-0/+1044
/* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
 * Copyright (C) 2004 Red Hat Inc.
 * Copyright (C) 2010 TigerVNC Team
 * Copyright 2015-2024 Pierre Ossman for Cendio AB
 * 
 * This is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this software; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
 * USA.
 */

#ifndef __CORE_EXCEPTION_H__
#define __CORE_EXCEPTION_H__

#include <stdexcept>
#include <string>

namespace core {

  class posix_error : public std::runtime_error {
  public:
    int err;
    posix_error(const char* what_arg, int err_) noexcept;
    posix_error(const std::string& what_arg, int err_) noexcept;
  private:
    std::string strerror(int err_) const noexcept;
  };

#ifdef WIN32
  class win32_error : public std::runtime_error {
  public:
    unsigned err;
    win32_error(const char* what_arg, unsigned err_) noexcept;
    win32_error(const std::string& what_arg, unsigned err_) noexcept;
  private:
    std::string strerror(unsigned err_) const noexcept;
  };
#endif

#ifdef WIN32
  class socket_error : public win32_error {
  public:
    socket_error(const char* what_arg, unsigned err_) noexcept : win32_error(what_arg, err_) {}
    socket_error(const std::string& what_arg, unsigned err_) noexcept : win32_error(what_arg, err_) {}
  };
#else
  class socket_error : public posix_error {
  public:
    socket_error(const char* what_arg, unsigned err_) noexcept : posix_error(what_arg, err_) {}
    socket_error(const std::string& what_arg, unsigned err_) noexcept : posix_error(what_arg, err_) {}
  };
#endif

  class getaddrinfo_error : public std::runtime_error {
  public:
    int err;
    getaddrinfo_error(const char* s, int err_) noexcept;
    getaddrinfo_error(const std::string& s, int err_) noexcept;
  private:
    std::string strerror(int err_) const noexcept;
  };

}

#endif