الصنف RuntimeError
في روبي
< Ruby
اذهب إلى التنقل
اذهب إلى البحث
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
يُطلق الاستثناء RuntimeError
عند محاولة تنفيذ عملية غير صالحة. في حال عدم تحديد صنف الاستثناء Exception
، سيُطلق الاستثناء Kernel.raise
.
الشيفرة التالية:
raise "ouch"
ستطلق الاستثناء RuntimeError
بالشكل التالي:
RuntimeError: ouch