使用语义化的异常(特别是基于继承的异常)描述错误是一种良好的编程习惯和建议。同时异常堆栈包含错误发生的代码位置,方便排错,以及对类似错误进行分组。 original: https://dev.to/appsignal/custom-exceptions-in-ruby-1n1b  AppSignal Custom Exceptions in Ruby  Robert Beekman  Jul 3 #ruby #learning #tutorial A little while ago we talked about exceptions in Ruby. This time we explore ways of creating custom exceptions specific to your app’s needs. Let’s say we have a method that handles the uploading of images while only allowing JPEG… Continue Reading [Reproduce]Custom Exceptions in Ruby