From 82ec0d8c8d1ba164aa2d29c8f1203730aa51988c Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Wed, 29 Jan 2025 13:38:11 +1300 Subject: Raises of Internal_FLTK_Error now come with error messages --- body/fltk-widgets-valuators-dials.adb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'body/fltk-widgets-valuators-dials.adb') diff --git a/body/fltk-widgets-valuators-dials.adb b/body/fltk-widgets-valuators-dials.adb index 6dc9e69..93a636a 100644 --- a/body/fltk-widgets-valuators-dials.adb +++ b/body/fltk-widgets-valuators-dials.adb @@ -270,17 +270,21 @@ package body FLTK.Widgets.Valuators.Dials is (This : in out Dial; Event : in Event_Kind; X, Y, W, H : in Integer) - return Event_Outcome is - begin - return Event_Outcome'Val (fl_dial_handle2 + return Event_Outcome + is + Result : Interfaces.C.int := fl_dial_handle2 (This.Void_Ptr, Event_Kind'Pos (Event), Interfaces.C.int (X), Interfaces.C.int (Y), Interfaces.C.int (W), - Interfaces.C.int (H))); + Interfaces.C.int (H)); + begin + return Event_Outcome'Val (Result); exception - when Constraint_Error => raise Internal_FLTK_Error; + when Constraint_Error => raise Internal_FLTK_Error with + "Fl_Dial::handle returned unexpected int value of " & + Interfaces.C.int'Image (Result); end Handle; -- cgit