What a formula worked out to, when it did not work out.
iex> Sheetshow.CellError.new("DIVIDE_BY_ZERO", "Function DIVIDE parameter 2 cannot be zero.")
%Sheetshow.CellError{type: :divide_by_zero, message: "Function DIVIDE parameter 2 cannot be zero."}These are never cell values. A cell holds what you would type into it (a
number, a string, a formula), and #DIV/0! is not something you can type; it
is what Sheets made of what you typed. So it arrives in a cell's meta under
:effective, alongside :formatted, and Sheetshow.Value need never know
it exists.
Summary
Functions
Builds one from what Google calls it. A type we do not know stays the string Google sent, rather than becoming an atom, because atoms are never collected and this comes off the wire.
The text a spreadsheet shows for the error, which is also what a values read
gives back for it: unlike a cell read, a values read cannot say a #DIV/0! is
an error rather than someone typing that string, so it arrives as the string.
Types
Functions
Builds one from what Google calls it. A type we do not know stays the string Google sent, rather than becoming an atom, because atoms are never collected and this comes off the wire.
iex> Sheetshow.CellError.new("REF").type
:ref
iex> Sheetshow.CellError.new("SOMETHING_NEW").type
"SOMETHING_NEW"
The text a spreadsheet shows for the error, which is also what a values read
gives back for it: unlike a cell read, a values read cannot say a #DIV/0! is
an error rather than someone typing that string, so it arrives as the string.
iex> Sheetshow.CellError.new("DIVIDE_BY_ZERO") |> Sheetshow.CellError.to_text()
"#DIV/0!"