def error_to_sym(error)
      error.to_s.split(/::/)[-1]
        .gsub(/Error$/, '')
        .gsub(/[[:upper:]]/)
        .with_index {|k, i| i == 0 ? k : ('_' + k)}
        .downcase
        .to_sym
    end
def error_to_sym(error)
      error.to_s.split(/::/)[-1]
        .gsub(/Error$/, '')
        .gsub(/[[:upper:]]/)
        .with_index {|k, i| i == 0 ? k : ('_' + k)}
        .downcase
        .to_sym
    end
Error formats