Skip to content

Better error message: KeyError #35955

@BeastyBlacksmith

Description

@BeastyBlacksmith

I think a low hanging fruit might be the improvement of the printing of KeyError from:

julia> Dict( :a => 1, :b => 2)[:c]
ERROR: KeyError: key :c not found
Stacktrace:
 [1] getindex(::Dict{Symbol,Int64}, ::Symbol) at ./dict.jl:477
 [2] top-level scope at none:0

To

ERROR: KeyError: key :c not found. Available keys are: (:a, :b).

Metadata

Metadata

Assignees

No one assigned

    Labels

    collectionsData structures holding multiple items, e.g. sets

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions