From 1e7da343462b4079b4a64b4ce8be2ab7908c7316 Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Thu, 8 Jan 2015 17:23:21 -0800 Subject: [PATCH] Use code rather than name for custom error --- src/project.coffee | 2 +- src/workspace.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/project.coffee b/src/project.coffee index e19667f16..e0289c34a 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -283,7 +283,7 @@ class Project extends Model buildBuffer: (absoluteFilePath) -> if fs.getSizeSync(absoluteFilePath) >= 2 * 1048576 # 2MB error = new Error("Atom can only handle files < 2MB for now.") - error.name = 'OversizeFileError' + error.code = 'EFILETOOLARGE' throw error buffer = new TextBuffer({filePath: absoluteFilePath}) diff --git a/src/workspace.coffee b/src/workspace.coffee index 3c11c7d27..e86401d86 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -451,7 +451,7 @@ class Workspace extends Model try item ?= atom.project.open(uri, options) catch error - if error.name is 'OversizeFileError' + if error.code is 'EFILETOOLARGE' atom.notifications.addWarning(error.message + " Large file support is being tracked at [atom/atom#307](https://github.com/atom/atom/issues/307).") else if error.code is 'ENOENT' and error.path? atom.notifications.addWarning("No such file '#{error.path}'")