Catching exceptions by type

How to catch exceptions by type? In the documentation I only saw examples catching all types:

try
  # some code
catch e # all types
  if e isa AssertionError
    # handle exception
  end
end

else rethrow(e)

1 Like

I like it, it is simple and doesn’t require extra syntax.