Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle binwrite failures in installer
Since Elixir 1.16, the IO.binwrite/2 function no longer returns an :ok- or :error tuple. Instead, it simply raises an error when it fails. To keep compatibility with previous versions of Elixir, this patch implements binwrite_with_result, which is a delegate of IO.binwrite/2 on versions before 1.16, and a try-catch wrapper for Elixir 1.16 and above. With that function in place, the precious implementation is restored, which prints "Failure!" before the error message in the unlikely event that the write fails. Co-authored-by: Tom de Bruijn <tom@tomdebruijn.com>
- Loading branch information