Arcane  v4.1.1.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
arcane/src/arcane/utils/Exception.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* Exception.cc (C) 2000-2025 */
9/* */
10/* Déclarations et définitions liées aux exceptions. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/Exception.h"
16
17/*---------------------------------------------------------------------------*/
18/*---------------------------------------------------------------------------*/
19
20namespace Arcane
21{
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29extern "C++" ARCANE_UTILS_EXPORT Integer
30arcanePrintAnyException(ITraceMng* msg, bool is_no_continue)
31{
32 return ExceptionUtils::print(msg, is_no_continue);
33}
34
35/*---------------------------------------------------------------------------*/
36/*---------------------------------------------------------------------------*/
37
38extern "C++" ARCANE_UTILS_EXPORT Integer
39arcanePrintStdException(const std::exception& ex, ITraceMng* msg, bool is_no_continue)
40{
41 return ExceptionUtils::print(ex, msg, is_no_continue);
42}
43
44/*---------------------------------------------------------------------------*/
45/*---------------------------------------------------------------------------*/
46
47extern "C++" ARCANE_UTILS_EXPORT Integer
48arcanePrintArcaneException(const Exception& ex, ITraceMng* msg, bool is_no_continue)
49{
50 return ExceptionUtils::print(ex, msg, is_no_continue);
51}
52
53/*---------------------------------------------------------------------------*/
54/*---------------------------------------------------------------------------*/
55
56extern "C++" ARCANE_UTILS_EXPORT Integer
57arcaneCallFunctionAndCatchException(std::function<void()> function)
58{
59 return ExceptionUtils::callWithTryCatch(function);
60}
61
62/*---------------------------------------------------------------------------*/
63/*---------------------------------------------------------------------------*/
64
65extern "C++" ARCANE_UTILS_EXPORT void
66arcaneCallFunctionAndTerminateIfThrow(std::function<void()> function)
67{
69}
70
71/*---------------------------------------------------------------------------*/
72/*---------------------------------------------------------------------------*/
73
74} // End namespace Arcane
75
76/*---------------------------------------------------------------------------*/
77/*---------------------------------------------------------------------------*/
Fonctions utilitaires pour la gestion des exceptions.
ARCCORE_COMMON_EXPORT Int32 print(ITraceMng *tm, bool is_no_continue=true)
Imprime un message pour une exception inconnue.
ARCCORE_COMMON_EXPORT void callAndTerminateIfThrow(std::function< void()> function, ITraceMng *tm=nullptr)
Appelle une fonction et termine le programme en cas d'exception.
ARCCORE_COMMON_EXPORT Int32 callWithTryCatch(std::function< void()> function, ITraceMng *tm=nullptr)
Appelle une fonction en récupérant et affichant les exceptions.
Classe de base d'une exception.
Interface du gestionnaire de traces.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.
Integer arcaneCallFunctionAndCatchException(std::function< void()> function)
void arcaneCallFunctionAndTerminateIfThrow(std::function< void()> function)