e576bb2002-10-11Martin Nilsson /* || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. */
3e7aa82000-11-30Fredrik Hübinette (Hubbe) 
aad99b2001-03-28Fredrik Hübinette (Hubbe) #ifndef PIKE_ERROR_H #define PIKE_ERROR_H
3e7aa82000-11-30Fredrik Hübinette (Hubbe) 
c171602003-04-01Martin Stjernholm #ifdef CONFIGURE_TEST #include <stdio.h> static inline void Pike_fatal (const char *fmt, ...) { va_list args; va_start (args, fmt); vfprintf (stderr, fmt, args); abort(); } #define Pike_error Pike_fatal #else /* !CONFIGURE_TEST */
22549b2006-08-02Martin Stjernholm #include "global.h"
3e7aa82000-11-30Fredrik Hübinette (Hubbe) #include <setjmp.h>
50f6262015-11-27Henrik Grubbström (Grubba) #if defined(HAVE_SIGSETJMP) && defined(HAVE_SIGLONGJMP) #define HAVE_AND_USE_SIGSETJMP #define LOW_JMP_BUF sigjmp_buf #define LOW_SETJMP(X) sigsetjmp(X, 0) #define LOW_LONGJMP(X, Y) siglongjmp(X, Y) #elif defined(HAVE__SETJMP) && defined(HAVE__LONGJMP) #define HAVE_AND_USE__SETJMP #define LOW_JMP_BUF jmp_buf #define LOW_SETJMP(X) _setjmp(X) #define LOW_LONGJMP(X, Y) _longjmp(X, Y) #else /* Assume we have setjmp and longjmp, they are after all defined by ANSI C. */ #define HAVE_AND_USE_SETJMP #define LOW_JMP_BUF jmp_buf #define LOW_SETJMP(X) setjmp(X) #define LOW_LONGJMP(X, Y) longjmp(X, Y) #endif
aad99b2001-03-28Fredrik Hübinette (Hubbe) #if 1
c299402001-11-10Martin Stjernholm PMOD_EXPORT extern const char msg_fatal_error[];
5aad932002-08-15Marcus Comstedt #define Pike_fatal \
6b94f92012-11-14Arne Goedeke  (fprintf(stderr,msg_fatal_error,__FILE__,(long)__LINE__),debug_fatal)
aad99b2001-03-28Fredrik Hübinette (Hubbe) #else /* This is useful when debugging assembler code sometimes... -Hubbe */
5aad932002-08-15Marcus Comstedt #define Pike_fatal \
aad99b2001-03-28Fredrik Hübinette (Hubbe)  (fprintf(stderr,"%s: Fatal error:\n",__FILE__ ":" DEFINETOSTR(__LINE__) ),debug_fatal) #endif
74e6b32009-03-15Martin Stjernholm #define pike_fatal_dloc \ (fprintf (stderr, msg_fatal_error, DLOC_ARGS), debug_fatal)
fce4702003-02-18Martin Stjernholm #ifndef NO_PIKE_SHORTHAND #define fatal Pike_fatal #endif
987ef42007-06-17Martin Stjernholm PMOD_EXPORT DECLSPEC(noreturn) void debug_va_fatal(const char *fmt, va_list args) ATTRIBUTE((noreturn));
f38f282004-11-14Martin Stjernholm PMOD_EXPORT DECLSPEC(noreturn) void debug_fatal(const char *fmt, ...) ATTRIBUTE((noreturn));
aad99b2001-03-28Fredrik Hübinette (Hubbe) 
3e7aa82000-11-30Fredrik Hübinette (Hubbe) #include "svalue.h" typedef void (*error_call)(void *); #ifndef STRUCT_FRAME_DECLARED #define STRUCT_FRAME_DECLARED struct pike_frame; #endif
97258e2008-05-23Martin Stjernholm #define THROW_N_A 0
3e7aa82000-11-30Fredrik Hübinette (Hubbe) #define THROW_ERROR 10 #define THROW_THREAD_EXIT 20 #define THROW_THREAD_KILLED 30 #define THROW_EXIT 40 #define THROW_MAX_SEVERITY 100 /* #define ONERROR_DEBUG */ #ifdef ONERROR_DEBUG
a91d9a2016-01-11Martin Nilsson #define OED_FPRINTF(...) fprintf(stderr, __VA_ARGS__)
3e7aa82000-11-30Fredrik Hübinette (Hubbe) #else /* !ONERROR_DEBUG */
a91d9a2016-01-11Martin Nilsson #define OED_FPRINTF(...)
3e7aa82000-11-30Fredrik Hübinette (Hubbe) #endif /* ONERROR_DEBUG */ typedef struct ONERROR { struct ONERROR *previous;
62384e2008-04-12Henrik Grubbström (Grubba)  struct pike_frame *frame_pointer;
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  error_call func; void *arg; #ifdef PIKE_DEBUG const char *file; int line; #endif /* PIKE_DEBUG */ } ONERROR; typedef struct JMP_BUF { struct JMP_BUF *previous;
50f6262015-11-27Henrik Grubbström (Grubba)  LOW_JMP_BUF recovery;
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  struct pike_frame *frame_pointer; ptrdiff_t stack_pointer; ptrdiff_t mark_sp; INT32 severity; ONERROR *onerror; #ifdef PIKE_DEBUG int line;
50e4812010-02-19Stephen R. van den Berg  const char *file;
ca176b2006-02-27Martin Stjernholm  int on_stack;
3e7aa82000-11-30Fredrik Hübinette (Hubbe) #endif } JMP_BUF;
f31ced2000-12-16Marcus Comstedt PMOD_EXPORT extern struct svalue throw_value;
cdac262014-12-06Bill Welliver PMOD_EXPORT extern int throw_severity;
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  #ifdef PIKE_DEBUG
c299402001-11-10Martin Stjernholm PMOD_EXPORT extern const char msg_unsetjmp_nosync_1[]; PMOD_EXPORT extern const char msg_unsetjmp_nosync_2[];
9ba1e52008-05-27Henrik Grubbström (Grubba) #define UNSETJMP(X) do{ \ check_recovery_context(); \
a91d9a2016-01-11Martin Nilsson  OED_FPRINTF("unsetjmp(%p) %s:%d\n", \ &(X), __FILE__, __LINE__); \
9ba1e52008-05-27Henrik Grubbström (Grubba)  if(Pike_interpreter.recoveries != &X) { \ if(Pike_interpreter.recoveries) \ Pike_fatal(msg_unsetjmp_nosync_1, \ Pike_interpreter.recoveries->file); \ else \
92d0c42008-12-14Martin Stjernholm  Pike_fatal("%s", msg_unsetjmp_nosync_2); \
9ba1e52008-05-27Henrik Grubbström (Grubba)  } \ Pike_interpreter.recoveries=X.previous; \ check_recovery_context(); \
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  }while (0)
38e1e82001-11-08Fredrik Hübinette (Hubbe)  #ifdef DMALLOC_LOCATION #define PERR_LOCATION() DMALLOC_LOCATION() #else #define PERR_LOCATION() ( __FILE__ ":" DEFINETOSTR(__LINE__) ) #endif
239b6f2008-12-29Henrik Grubbström (Grubba) #define DEBUG_INIT_REC_ARGS , int on_stack, const char *location
50f6262015-11-27Henrik Grubbström (Grubba) #define SETJMP(X) LOW_SETJMP((init_recovery(&X, 0, 1, PERR_LOCATION())->recovery))
b3d3742002-11-23Martin Stjernholm #define SETJMP_SP(jmp, stack_pop_levels) \
50f6262015-11-27Henrik Grubbström (Grubba)  LOW_SETJMP((init_recovery(&jmp, stack_pop_levels, 1, PERR_LOCATION())->recovery))
ca176b2006-02-27Martin Stjernholm #else /* !PIKE_DEBUG */ #define DEBUG_INIT_REC_ARGS
50f6262015-11-27Henrik Grubbström (Grubba) #define SETJMP(X) LOW_SETJMP((init_recovery(&X, 0)->recovery))
b3d3742002-11-23Martin Stjernholm #define SETJMP_SP(jmp, stack_pop_levels) \
50f6262015-11-27Henrik Grubbström (Grubba)  LOW_SETJMP((init_recovery(&jmp, stack_pop_levels)->recovery))
3e7aa82000-11-30Fredrik Hübinette (Hubbe) #define UNSETJMP(X) Pike_interpreter.recoveries=X.previous
ca176b2006-02-27Martin Stjernholm #endif /* !PIKE_DEBUG */
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  #ifdef PIKE_DEBUG
9ba1e52008-05-27Henrik Grubbström (Grubba) #define SET_ONERROR(X,Y,Z) \ do{ \ check_recovery_context(); \
a91d9a2016-01-11Martin Nilsson  OED_FPRINTF("SET_ONERROR(%p, %p, %p) %s:%d\n", \ &(X), (Y), (void *)(Z), __FILE__, __LINE__); \
9ba1e52008-05-27Henrik Grubbström (Grubba)  X.frame_pointer = Pike_interpreter.frame_pointer; \ X.func=(error_call)(Y); \ DO_IF_DMALLOC( if( X.func == free ) X.func=dmalloc_free); \ X.arg=(void *)(Z); \
5832012009-07-22Henrik Grubbström (Grubba)  if(!Pike_interpreter.recoveries) { \ X.previous = NULL; \ break; \ } \
9ba1e52008-05-27Henrik Grubbström (Grubba)  X.previous=Pike_interpreter.recoveries->onerror; \ X.file = __FILE__; \ X.line = __LINE__; \ Pike_interpreter.recoveries->onerror=&X; \
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  }while(0)
c299402001-11-10Martin Stjernholm PMOD_EXPORT extern const char msg_last_setjmp[]; PMOD_EXPORT extern const char msg_unset_onerr_nosync_1[]; PMOD_EXPORT extern const char msg_unset_onerr_nosync_2[];
9ba1e52008-05-27Henrik Grubbström (Grubba) #define UNSET_ONERROR(X) do { \ check_recovery_context(); \
a91d9a2016-01-11Martin Nilsson  OED_FPRINTF("UNSET_ONERROR(%p) %s:%d\n", \ &(X), __FILE__, __LINE__); \
9ba1e52008-05-27Henrik Grubbström (Grubba)  if(!Pike_interpreter.recoveries) break; \ if(Pike_interpreter.recoveries->onerror != &(X)) { \ fprintf(stderr,msg_last_setjmp, \ Pike_interpreter.recoveries->file); \ if (Pike_interpreter.recoveries->onerror) { \ Pike_fatal(msg_unset_onerr_nosync_1, \ Pike_interpreter.recoveries->onerror, &(X), \
5aad932002-08-15Marcus Comstedt  Pike_interpreter.recoveries->onerror->file); \
9ba1e52008-05-27Henrik Grubbström (Grubba)  } else { \
92d0c42008-12-14Martin Stjernholm  Pike_fatal("%s", msg_unset_onerr_nosync_2); \
9ba1e52008-05-27Henrik Grubbström (Grubba)  } \ } \ Pike_interpreter.recoveries->onerror=(X).previous; \
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  } while(0)
c299402001-11-10Martin Stjernholm PMOD_EXPORT extern const char msg_assert_onerr[];
3e7aa82000-11-30Fredrik Hübinette (Hubbe) #define ASSERT_ONERROR(X) \ do{ \ if (!Pike_interpreter.recoveries) break; \ if (Pike_interpreter.recoveries->onerror != &X) { \
5aad932002-08-15Marcus Comstedt  Pike_fatal(msg_assert_onerr, \ __FILE__, __LINE__, &(X)); \
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  } \ }while(0) #else /* !PIKE_DEBUG */ #define SET_ONERROR(X,Y,Z) \ do{ \ X.func=(error_call)(Y); \ X.arg=(void *)(Z); \
62384e2008-04-12Henrik Grubbström (Grubba)  X.frame_pointer = Pike_interpreter.frame_pointer; \
e9db7b2009-08-07Henrik Grubbström (Grubba)  if(!Pike_interpreter.recoveries) { \ X.previous = NULL; \ break; \ } \
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  X.previous=Pike_interpreter.recoveries->onerror; \ Pike_interpreter.recoveries->onerror=&X; \ }while(0) #define UNSET_ONERROR(X) Pike_interpreter.recoveries && (Pike_interpreter.recoveries->onerror=X.previous) #define ASSERT_ONERROR(X) #endif /* PIKE_DEBUG */ #define CALL_AND_UNSET_ONERROR(X) do { \ UNSET_ONERROR(X); \
a3b1dc2010-09-27Henrik Grubbström (Grubba)  X.func(X.arg); \
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  }while(0) #if defined(PIKE_DEBUG) && 0 /* Works, but probably not interresting for most people * /grubba 1998-04-11 */
5bb0b22003-07-30Martin Stjernholm #define PIKE_ERROR(NAME, TEXT, SP, ARGS) new_error(NAME, TEXT, SP, ARGS, __FILE__, __LINE__)
3e7aa82000-11-30Fredrik Hübinette (Hubbe) #else
5bb0b22003-07-30Martin Stjernholm #define PIKE_ERROR(NAME, TEXT, SP, ARGS) new_error(NAME, TEXT, SP, ARGS, NULL, 0)
3e7aa82000-11-30Fredrik Hübinette (Hubbe) #endif /* PIKE_DEBUG */ /* Prototypes begin here */
f31ced2000-12-16Marcus Comstedt PMOD_EXPORT void check_recovery_context(void);
071adc2002-11-25Martin Stjernholm PMOD_EXPORT void pike_gdb_breakpoint(INT32 args);
ca176b2006-02-27Martin Stjernholm PMOD_EXPORT JMP_BUF *init_recovery(JMP_BUF *r, size_t stack_pop_levels DEBUG_INIT_REC_ARGS);
3e7aa82000-11-30Fredrik Hübinette (Hubbe) PMOD_EXPORT DECLSPEC(noreturn) void pike_throw(void) ATTRIBUTE((noreturn));
66a1572001-01-12Martin Stjernholm PMOD_EXPORT void push_error(const char *description);
fcec352000-12-04Martin Stjernholm PMOD_EXPORT DECLSPEC(noreturn) void low_error(const char *buf) ATTRIBUTE((noreturn));
d5ff1b2008-10-04Martin Stjernholm PMOD_EXPORT void va_make_error (const char *fmt, va_list args); PMOD_EXPORT void DECLSPEC(noreturn) va_error(const char *fmt, va_list args) ATTRIBUTE((noreturn)); PMOD_EXPORT void make_error (const char *fmt, ...); PMOD_EXPORT DECLSPEC(noreturn) void Pike_error(const char *fmt,...) ATTRIBUTE((noreturn));
3e7aa82000-11-30Fredrik Hübinette (Hubbe) PMOD_EXPORT DECLSPEC(noreturn) void new_error(const char *name, const char *text, struct svalue *oldsp, INT32 args, const char *file, int line) ATTRIBUTE((noreturn));
c299402001-11-10Martin Stjernholm PMOD_EXPORT void exit_on_error(const void *msg); PMOD_EXPORT void fatal_on_error(const void *msg);
f38f282004-11-14Martin Stjernholm PMOD_EXPORT DECLSPEC(noreturn) void debug_fatal(const char *fmt, ...) ATTRIBUTE((noreturn));
30533b2008-05-27Martin Stjernholm PMOD_EXPORT DECLSPEC(noreturn) void generic_error_va( struct object *o, const char *func, const struct svalue *base_sp, int args,
55af8e2008-05-27Henrik Grubbström (Grubba)  const char *fmt, va_list *fmt_args)
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  ATTRIBUTE((noreturn));
78283b2001-08-16Martin Stjernholm PMOD_EXPORT DECLSPEC(noreturn) void throw_error_object( struct object *o,
c299402001-11-10Martin Stjernholm  const char *func,
78283b2001-08-16Martin Stjernholm  struct svalue *base_sp, int args,
f38f282004-11-14Martin Stjernholm  const char *desc, ...) ATTRIBUTE((noreturn));
f31ced2000-12-16Marcus Comstedt PMOD_EXPORT void DECLSPEC(noreturn) generic_error(
c299402001-11-10Martin Stjernholm  const char *func,
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  struct svalue *base_sp, int args,
f38f282004-11-14Martin Stjernholm  const char *desc, ...) ATTRIBUTE((noreturn));
a7bd072000-12-18Fredrik Hübinette (Hubbe) PMOD_EXPORT DECLSPEC(noreturn) void index_error(
c299402001-11-10Martin Stjernholm  const char *func,
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  struct svalue *base_sp, int args, struct svalue *val, struct svalue *ind,
f38f282004-11-14Martin Stjernholm  const char *desc, ...) ATTRIBUTE((noreturn));
a7bd072000-12-18Fredrik Hübinette (Hubbe) PMOD_EXPORT DECLSPEC(noreturn) void bad_arg_error(
c299402001-11-10Martin Stjernholm  const char *func,
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  struct svalue *base_sp, int args, int which_arg,
c299402001-11-10Martin Stjernholm  const char *expected_type,
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  struct svalue *got,
f38f282004-11-14Martin Stjernholm  const char *desc, ...) ATTRIBUTE((noreturn));
f31ced2000-12-16Marcus Comstedt PMOD_EXPORT void DECLSPEC(noreturn) math_error(
c299402001-11-10Martin Stjernholm  const char *func,
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  struct svalue *base_sp, int args, struct svalue *number,
f38f282004-11-14Martin Stjernholm  const char *desc, ...) ATTRIBUTE((noreturn));
f31ced2000-12-16Marcus Comstedt PMOD_EXPORT void DECLSPEC(noreturn) resource_error(
c299402001-11-10Martin Stjernholm  const char *func,
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  struct svalue *base_sp, int args,
c299402001-11-10Martin Stjernholm  const char *resource_type,
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  size_t howmuch,
f38f282004-11-14Martin Stjernholm  const char *desc, ...) ATTRIBUTE((noreturn));
f31ced2000-12-16Marcus Comstedt PMOD_EXPORT void DECLSPEC(noreturn) permission_error(
c299402001-11-10Martin Stjernholm  const char *func,
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  struct svalue *base_sp, int args,
c299402001-11-10Martin Stjernholm  const char *permission_type,
f38f282004-11-14Martin Stjernholm  const char *desc, ...) ATTRIBUTE((noreturn));
81aa522003-04-01Martin Stjernholm PMOD_EXPORT void wrong_number_of_args_error(const char *name, int args, int expected) ATTRIBUTE((noreturn));
3e7aa82000-11-30Fredrik Hübinette (Hubbe) void init_error(void); void cleanup_error(void); /* Prototypes end here */
a4a1722000-12-05Per Hedbor /* Some useful error macros. */
3e7aa82000-11-30Fredrik Hübinette (Hubbe) 
4e30de2003-03-28Martin Stjernholm /* This one should be used when the type of the argument is wrong. */
c299402001-11-10Martin Stjernholm PMOD_EXPORT extern const char msg_bad_arg[];
4e30de2003-03-28Martin Stjernholm #define SIMPLE_ARG_TYPE_ERROR(FUNC, ARG, EXPECT) \ bad_arg_error(FUNC, Pike_sp-args, args, ARG, EXPECT, Pike_sp+ARG-1-args,\ msg_bad_arg, ARG, FUNC, EXPECT) /* Less descriptive macro name kept for compatibility. */
3e7aa82000-11-30Fredrik Hübinette (Hubbe) #define SIMPLE_BAD_ARG_ERROR(FUNC, ARG, EXPECT) \ bad_arg_error(FUNC, Pike_sp-args, args, ARG, EXPECT, Pike_sp+ARG-1-args,\
4e30de2003-03-28Martin Stjernholm  msg_bad_arg, ARG, FUNC, EXPECT)
3e7aa82000-11-30Fredrik Hübinette (Hubbe) 
ec79ee2004-10-29Martin Stjernholm /* This one should be used when there's some problem with the argument * other than a bogus type. PROBLEM is a full sentence without a
4e30de2003-03-28Martin Stjernholm  * trailing newline. */ PMOD_EXPORT extern const char msg_bad_arg_2[]; #define SIMPLE_ARG_ERROR(FUNC, ARG, PROBLEM) \
81aa522003-04-01Martin Stjernholm  bad_arg_error (FUNC, Pike_sp-args, args, ARG, NULL, Pike_sp+ARG-1-args, \ msg_bad_arg_2, ARG, FUNC, PROBLEM)
ba15e02003-03-28Martin Stjernholm  #define SIMPLE_WRONG_NUM_ARGS_ERROR(FUNC, ARG) \
4e30de2003-03-28Martin Stjernholm  wrong_number_of_args_error (FUNC, args, ARG) /* The following is for compatibility. */ #define SIMPLE_TOO_FEW_ARGS_ERROR(FUNC, ARG) \ wrong_number_of_args_error (FUNC, args, ARG)
3e7aa82000-11-30Fredrik Hübinette (Hubbe) 
c299402001-11-10Martin Stjernholm PMOD_EXPORT extern const char msg_out_of_mem[];
40d6ed2006-05-10Martin Stjernholm PMOD_EXPORT extern const char msg_out_of_mem_2[];
9ba1e52008-05-27Henrik Grubbström (Grubba) #if 1
40d6ed2006-05-10Martin Stjernholm static INLINE void DECLSPEC(noreturn) out_of_memory_error ( const char *func, struct svalue *base_sp, int args, size_t amount) ATTRIBUTE((noreturn)); static INLINE void DECLSPEC(noreturn) out_of_memory_error ( const char *func, struct svalue *base_sp, int args, size_t amount) { resource_error (func, base_sp, args, "memory", amount,
6319402007-07-03Martin Stjernholm  amount ? msg_out_of_mem_2 : msg_out_of_mem, amount);
40d6ed2006-05-10Martin Stjernholm }
9ba1e52008-05-27Henrik Grubbström (Grubba) #else #define out_of_memory_error(FUNC, BASE_SP, ARGS, AMOUNT) \ do { \ size_t amount_ = (AMOUNT); \ int args_ = (ARGS); \ resource_error((FUNC), (BASE_SP), args_, "memory", amount_, \ msg_out_of_mem_2, amount_); \ } while(0) #endif
40d6ed2006-05-10Martin Stjernholm 
3e7aa82000-11-30Fredrik Hübinette (Hubbe) #define SIMPLE_OUT_OF_MEMORY_ERROR(FUNC, AMOUNT) \
40d6ed2006-05-10Martin Stjernholm  out_of_memory_error(FUNC, Pike_sp-args, args, AMOUNT)
3e7aa82000-11-30Fredrik Hübinette (Hubbe) 
c299402001-11-10Martin Stjernholm PMOD_EXPORT extern const char msg_div_by_zero[];
3e7aa82000-11-30Fredrik Hübinette (Hubbe) #define SIMPLE_DIVISION_BY_ZERO_ERROR(FUNC) \
c299402001-11-10Martin Stjernholm  math_error(FUNC, Pike_sp-args, args, 0, msg_div_by_zero)
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  #ifndef PIKE_DEBUG #define check_recovery_context() ((void)0) #endif /* Experimental convenience exception macros. */ #define exception_try \ do \ { \ int __exception_rethrow, __is_exception; \ JMP_BUF exception; \ __is_exception = SETJMP(exception); \ __exception_rethrow = 0; \ if(__is_exception) /* rethrow needs this */ \ UNSETJMP(exception); \ if(!__is_exception)
13670c2015-05-25Martin Nilsson 
3e7aa82000-11-30Fredrik Hübinette (Hubbe) #define exception_catch_if \ else if #define exception_catch(e) \ exception_catch_if(exception->severity = (e)) #define exception_catch_all \ exception_catch_if(1) #define exception_semicatch_all \ exception_catch_if((__exception_rethrow = 1)) #define rethrow \ pike_throw() #define exception_endtry \ else \ __exception_rethrow = 1; \
c1b8f02001-07-02Martin Stjernholm  if(__is_exception) { \ free_svalue(&throw_value); \
1ab4ac2008-01-26Martin Stjernholm  mark_free_svalue (&throw_value); \
c1b8f02001-07-02Martin Stjernholm  } \ else \
3e7aa82000-11-30Fredrik Hübinette (Hubbe)  UNSETJMP(exception); \ if(__exception_rethrow) \ rethrow; \ } \ while(0)
a4a1722000-12-05Per Hedbor /* Generic error stuff */
3e7aa82000-11-30Fredrik Hübinette (Hubbe) #define ERR_EXT_DECLARE #include "errors.h"
c171602003-04-01Martin Stjernholm #endif /* !CONFIGURE_TEST */
aad99b2001-03-28Fredrik Hübinette (Hubbe) #endif /* PIKE_ERROR_H */