diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2024-12-01 13:34:58 +1300 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2024-12-01 13:34:58 +1300 |
commit | df63542510b6912405f3709b204ad3a59548c917 (patch) | |
tree | f5b1fb7b64a7613b1d7de990c22d9c78a5b95292 /src/fltk-text_buffers.adb | |
parent | ba29d58fb21f0f376dd4c09df61b4e1d38cb1226 (diff) |
Improved specificity of exceptions with Internal_FLTK_Error and Storage_Error
Diffstat (limited to 'src/fltk-text_buffers.adb')
-rw-r--r-- | src/fltk-text_buffers.adb | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/fltk-text_buffers.adb b/src/fltk-text_buffers.adb index 5d88b10..1afa2a7 100644 --- a/src/fltk-text_buffers.adb +++ b/src/fltk-text_buffers.adb @@ -24,6 +24,14 @@ use type package body FLTK.Text_Buffers is + function strerror + (Errnum : in Interfaces.C.int) + return Interfaces.C.Strings.chars_ptr; + pragma Import (C, strerror, "strerror"); + + + + function new_fl_text_buffer (RS, PGS : in Interfaces.C.int) return Storage.Integer_Address; @@ -634,7 +642,7 @@ package body FLTK.Text_Buffers is Interfaces.C.int (Buffer)); begin if Err_No /= 0 then - raise Storage_Error; + raise Storage_Error with Interfaces.C.Strings.Value (strerror (Err_No)); end if; end Load_File; @@ -650,7 +658,7 @@ package body FLTK.Text_Buffers is Interfaces.C.int (Buffer)); begin if Err_No /= 0 then - raise Storage_Error; + raise Storage_Error with Interfaces.C.Strings.Value (strerror (Err_No)); end if; end Append_File; @@ -668,7 +676,7 @@ package body FLTK.Text_Buffers is Interfaces.C.int (Buffer)); begin if Err_No /= 0 then - raise Storage_Error; + raise Storage_Error with Interfaces.C.Strings.Value (strerror (Err_No)); end if; end Insert_File; @@ -687,7 +695,7 @@ package body FLTK.Text_Buffers is Interfaces.C.int (Buffer)); begin if Err_No /= 0 then - raise Storage_Error; + raise Storage_Error with Interfaces.C.Strings.Value (strerror (Err_No)); end if; end Output_File; @@ -703,7 +711,7 @@ package body FLTK.Text_Buffers is Interfaces.C.int (Buffer)); begin if Err_No /= 0 then - raise Storage_Error; + raise Storage_Error with Interfaces.C.Strings.Value (strerror (Err_No)); end if; end Save_File; |