2 * Copyright (C) 2024 Mikulas Patocka
4 * This file is part of Ajla.
6 * Ajla is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, either version 3 of the License, or (at your option) any later
11 * Ajla is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along with
16 * Ajla. If not, see <https://www.gnu.org/licenses/>.
23 fn exception_make(dst_type : type, ex_class ex_type ex_code : int, stack_trace : bool) : dst_type;
24 fn exception_make_str(dst_type : type, ex_class ex_type ex_code : int, stack_trace : bool, str : bytes) : dst_type;
25 fn exception_copy(src_type : type, dst_type : type, s : src_type) : dst_type;
29 fn exception_make(dst_type : type, ex_class ex_type ex_code : int, stack_trace : bool) : dst_type
32 pcode IO IO_Exception_Make 1 4 0 =dest ex_class ex_type ex_code stack_trace;
36 fn exception_make_str(dst_type : type, ex_class ex_type ex_code : int, stack_trace : bool, str : bytes) : dst_type
39 pcode IO IO_Exception_Make 1 5 0 =dest ex_class ex_type ex_code stack_trace str;
43 fn exception_copy(src_type : type, dst_type : type, s : src_type) : dst_type
46 if is_exception s then [
48 pcode Copy_Type_Cast =d1 0 s;
51 dest := exception_make(dst_type, ec_sync, error_invalid_operation, 0, true);