Is there a option for different `MethodError` printing?

Hi all :slight_smile:

Sometimes I would like to switch to a different MethodError printing. The following is as it is:

julia> f(a,b,c,d,e,f,g,h,i,j,k) = nothing
f (generic function with 1 method)

julia> f(1)
ERROR: MethodError: no method matching f(::Int64)
Closest candidates are:
  f(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) at REPL[1]:1
Stacktrace:
 [1] top-level scope
   @ REPL[2]:1

And here is how I would like it to be:

julia> f(1)
ERROR: MethodError: no method matching 
  f(
      ::Int64
  )
Closest candidates are:
  f(
      a::Any, 
      b::Any, 
      c::Any, 
      d::Any, 
      e::Any, 
      f::Any, 
      g::Any, 
      h::Any, 
      i::Any, 
      j::Any, 
      k::Any
  ) at REPL[1]:1
Stacktrace:
 [1] top-level scope
   @ REPL[2]:1

Cheers

2 Likes

Where is the error printing defined?

I think it starts here. You could have searched MethodError in the GitHub, as it is rare to have MethodError explicitly thrown, there is not so many pages of results.

1 Like