Trapping I/O runtime errors in GPC