Currently, both of these functions accept two arguments: the error
title, and the error description. This function signature makes is hard
to keep adding options to these error creation functions, like an error
code, so this commit refactors them to take a single argument: an
options object containing `title` and `description` properties.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We recently hit an issue where Etcher builds produced on Ubuntu relied
on a too new glibc version, making them incompatible with GNU/Linux
distributions such as Debian Jessie.
As a solution, we will start producing builds on Debian Jessie, which
ensures that the builds will be compatible with the majority of
GNU/Linux versions out there.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We currently require this module to be available in the environment in
order to be able to build debian packages.
This commit adds it as an optional dependency, so we can have control
over the version that we use, to prevent any potential incompatibility.
We also update the `udif` package.json version to match what its on the
shrinkwrap file to avoid npm complaining about version mismatches.
See: https://github.com/resin-io/etcher/pull/1290
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
If we get EIO at this point, then it means that the writer did
everything it could to recover (like multiple retries), and the error
is truly an input/output error coming from the operating system.
In this commit, we show a nice user friendly message explaining what
happened, and advising users to try again with another drive, reader, or
port instead of showing an uncaught EIO error.
Change-Type: patch
Changelog-Entry: Show a friendly user message on EIO after many retries.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
If the user cancels the elevation dialog, then no event is emitted,
making it hard to track down what happened after the flash button was
pressed.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This version solves the issue regarding some messages
getting console logged (and reaching Sentry) as "[object Object]".
Change-Type: patch
Changelog-Entry: Upgrade `resin-corvus` to 1.0.0-beta.26.
This fixes two things: The format detection, and a bug in `udif`.
First, by categorizing the `.dmg` extension as compressed image,
`.isSupportedImage()` would attempt to detect the format after stripping
the extension, causing it to be misdetected.
Second, `udif`'s ReadStream didn't add the `dataForkOffset` to its
position when reading blocks, causing the wrong data to be read for some images,
in turn causing zlib to error on invalid headers.
Changes:
- Classify `.dmg` as `type: 'image'`
- Update `udif` to 0.8.0
Change-Type: patch
Changelog-Entry: Fix Apple disk image detection & streaming
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This version includes a fix to throw an `EUNPLUGGED` error instead of an
`UNKNOWN` one when unplugging an SD Card from an internal reader on
Windows.
Change-Type: patch
Changelog-Entry: Fix "UNKNOWN: unknown error" error when unplugging an SD Card from an internal reader on Windows.
See: https://github.com/resin-io-modules/etcher-image-write/pull/97
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Windows will not react to dynamically set environment variables (e.g:
`process.env.MOUNTUTILS_DEBUG = '1'`), so in order to workaround this
limitation, we set `MOUNTUTILS_DEBUG` in
`lib/child-writer/writer-proxy.js` when spawning the CLI, and we also
set `DEBUG='*'` in `lib/start.js`, so it gets picked up by the child
writer module, which spawns the writer proxy by inheriting the
environment.
This version accepts a `MOUNTUTILS_DEBUG` environment variable to make
the module output extra logging information, which we enable in this
commit as well.
See: https://github.com/resin-io-modules/mountutils/pull/25
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit shows a user friendly message when Etcher loses access to
the drive while flashing/validating, and prevents the cryptic errors
from getting to Sentry.
See: https://github.com/resin-io-modules/etcher-image-write/pull/96
Change-Type: minor
Changelog-Entry: Show a user friendly message when the drive is unplugged half-way through.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Currently, if the child writer receives a message from the writer
process that is not a valid robot object, then it will throw an error.
Now, we check if the message is a robot message, and if so, we try to
parse it (throwing errors if its indeed a malformed/incomplete robot
message), however we log it if not.
The main motivation behind this feature is that it will allows us to
print debugging information on the mountutils module, and have it
redirected to DevTools.
Change-Type: minor
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This release fixes an uncaught error when there is a validation error.
See: https://github.com/resin-io-modules/etcher-image-write/pull/94
Change-Type: patch
Changelog-Entry: Fix "function createError(opts) {}" error on validation failure.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This version contains a fix for when unmounting a physical drive with no
logical volumes attached.
See: http://github.com/resin-io-modules/mountutils/pull/24
Change-Type: patch
Changelog-Entry: Fix "Unmount failed, invalid drive" error on Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The rc2 debian package is not working because the path where the package files
is installed has changed. The change in paths comes from an upstream change
in the electron-installer-debian node package. So, updating the path here to
match the actuall install location.
This avoids codespell printing warnings for binary files
which have been added recently (`.iso`, `.dmg`), as well as dotfiles (i.e. `.DS_Store`).
Change-Type: patch
Consider the following scenario:
- The user selects an image from an external drive
- The user selects a drive
- The user unmounts/ejects the external drive
- The user clicks flash
The application state will contain an image path that is no longer
accessible, causing an ENOENT error when spawning the CLI process.
Change-Type: patch
Changelog-Entry: Display a user error if the image is no longer accessible when the writer starts.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
If the user tries to drag and drop a directory to the application, then
he'll get a scary `EISDIR` error message. This commit catches this
error, and display a nice user friendly message instead.
Change-Type: patch
Changelog-Entry: Prevent uncaught `EISDIR` when dropping a directory to the application.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
`jq` crashes when setting a value on a relative file. We workaround the
issue by using `jq` in a pipe instead of passing the file to it as an
argument.
See: https://github.com/stedolan/jq/issues/1155
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
The `application/x-apple-diskimage` handler doesn't return a path,
causing an issue when fetching the image metadata, and trying using the
path to determine if its a supported image type.
Change-Type: patch
Changelog-Entry: Fix "Path must be a string. Received undefined" when selecting Apple images.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This is a regression caused by
https://github.com/resin-io/etcher/pull/1257, which introduced a new way
to detect mime types by using the `mime-types` module.
This module, contrary to `file-type`, will detect certain ISO files as
`application/x-iso9660-image`, which Etcher doesn't know how to handle,
and will therefore should at the user that the format is unsupported.
Change-Type: patch
Changelog-Entry: Don't interpret certain ISO images as unsupported.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
We remove the usage of Angular from 'FlashStateModel' and its usage
throughout the project comes under the new 'flashState' moniker.
Depends: https://github.com/resin-io/etcher/pull/1261
This changes the test cases to just return the Promises,
to avoid timing out on failures and to provide better
error messages and stack traces.
Change-Type: patch
This commit implements our own version of the `is-elevated` module. The
reason behind this is that `is-elevated` relies on lots of unnecessary
modules, that eventually require `spawn-sync` and `try-thread-sleep`,
which conditionally require dependencies that are not even declared in
their `package.json`, causing issues when concatenating the Etcher CLI.
See: https://github.com/resin-io/etcher/pull/1235
See: https://github.com/resin-io/etcher/pull/1228
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>