4 ms·
How would you do error handling for the binary data? Let's say you expect something to match but it doesn't, what are your options then?
by pepve 11y ago
How would you do error handling for the binary data? Let's say you expect something to match but it doesn't, what are your options then?
- wcummings 11y agoIt raises a badmatch error, which should probably crash your process
- oomkiller 11y agoWell, if it is truly unexpected that it doesn't match the data, then you should just blow the process up and have it be automatically restarted by a supervisor. If the pattern is an alternative format, or something that you'll actually want to match, you just define another function with that pattern to test it against.