3 ms·
To be honest, the example given (a "read" method that wraps direct access and raises a custom exception) does not inspire confidence that the item is expected t
by qprofyeh 4y ago
To be honest, the example given (a "read" method that wraps direct access and raises a custom exception) does not inspire confidence that the item is expected to be there more often than not. There's certainly too little context to assume anything.
Expected or unexpected, either way there are two paths; I would return a Result/Option type.