2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "commons/Exception.h"
12 #include "utils/log.h"
17 XBMCCOMMONS_STANDARD_EXCEPTION(WrongTypeException
);
20 * UnimplementedException Can be used in places like the
21 * Control hierarchy where the
22 * requirements of dynamic language usage force us to add
23 * unimplemented methods to a class hierarchy. See the
24 * detailed explanation on the class Control for more.
26 class UnimplementedException
: public XbmcCommons::Exception
29 inline UnimplementedException(const UnimplementedException
& other
) = default;
30 inline UnimplementedException(const char* classname
, const char* methodname
) :
31 Exception("UnimplementedException")
32 { SetMessage("Unimplemented method: %s::%s(...)", classname
, methodname
); }
36 * This is what callback exceptions from the scripting language
39 class UnhandledException
: public XbmcCommons::Exception
42 inline UnhandledException(const UnhandledException
& other
) = default;
43 inline UnhandledException(const char* _message
,...) : Exception("UnhandledException") { XBMCCOMMONS_COPYVARARGS(_message
); }
49 * These macros allow the easy declaration (and definition) of parent
50 * class virtual methods that are not implemented until the child class.
51 * This is to support the idosyncracies of dynamically typed scripting
52 * languages. See the comment in AddonControl.h for more details.
54 #define THROW_UNIMP(classname) throw UnimplementedException(classname, __FUNCTION__)