Use binary_to_integer, try/catch in convert_key
Use binary_to_integer, try/catch in convert_key

binary_to_integer is the equivalent of list_to_integer(binary_to_list))

try/catch is more efficient that catch(expr) since the former
doesn't generate a stack trace unless explicitly asked.

ergl/antidote