controller_rescues_exception.puml
PlantUML source of a sequence diagram from the 4 approaches to handling service objects' returns post.
@startuml
participant Controller
participant Service
participant "AR model" as Model
Controller -> Service: call(...)
Service -> Model: save(...)
Controller <- Model: //ActiveRecord::RecordInvalid//
note right
Exception goes
through 2 layers
up to the controller
until it is rescued.
end note
@endumlDownload controller_rescues_exception.puml
PlantUML draws diagrams from plain text.
Paste the source into the online server,
or render it locally with plantuml -tsvg controller_rescues_exception.puml.