Skip to content

Commit

Permalink
Plugin error messages (#798)
Browse files Browse the repository at this point in the history
  • Loading branch information
karaggeorge authored Feb 16, 2020
1 parent 3b29d58 commit e094413
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
9 changes: 8 additions & 1 deletion main/export-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,15 @@ class ExportList {
this.currentExport.updateExport({
status: 'failed',
text: 'Export failed',
error: error.stack
error: {stack: error.stack, message: error.message}
});

const notification = new Notification({
title: this.currentExport.pluginName,
body: error.message
});
notification.show();

delete this.currentExport;
this._startNext();
}
Expand Down
15 changes: 12 additions & 3 deletions renderer/components/exports/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ export default class Export extends React.Component {
text,
percentage,
image,
cancel
cancel,
error
} = this.props;
const {menu} = this.state;

Expand Down Expand Up @@ -96,7 +97,7 @@ export default class Export extends React.Component {
<div className={fileNameClassName}>
{defaultFileName}
</div>
<div className="subtitle">{text}</div>
<div className="subtitle" title={error && error.message}>{text}{error && ` - ${error.message}`}</div>
</div>
<style jsx>{`
.export-container {
Expand Down Expand Up @@ -139,6 +140,7 @@ export default class Export extends React.Component {
.details {
flex: 1;
width: 234px;
}
.title {
Expand All @@ -158,6 +160,10 @@ export default class Export extends React.Component {
font-size: 12px;
color: var(--subtitle-color);
user-select: none;
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.export-container:hover {
Expand Down Expand Up @@ -187,5 +193,8 @@ Export.propTypes = {
cancel: PropTypes.elementType,
openInEditor: PropTypes.elementType,
filePath: PropTypes.string,
createdAt: PropTypes.string
createdAt: PropTypes.string,
error: PropTypes.objectOf({
message: PropTypes.string
})
};
2 changes: 1 addition & 1 deletion renderer/containers/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class ExportsContainer extends Container {
exports.unshift(updates);
} else {
if (!exports[index].error && updates.error) {
console.error(updates.error);
console.error(updates.error.stack);
}

exports[index] = updates;
Expand Down

0 comments on commit e094413

Please sign in to comment.