Skip to content

Commit

Permalink
better error message when project is not running yet but listing to r…
Browse files Browse the repository at this point in the history
…equested
  • Loading branch information
williamstein committed Aug 10, 2015
1 parent 1ce80c8 commit d1cbeac
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion salvus/compute.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ class ProjectClient extends EventEmitter
else
if status.state != 'running'
dbg("something went wrong and not running ?!")
cb("not running")
cb("not running") # exact callback error is used in the UI
else
dbg("status includes info about address...")
address =
Expand Down
3 changes: 3 additions & 0 deletions salvus/page/project_files.cjsx
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,9 @@ ProjectFiles = rclass
e = <ErrorDisplay title="No such directory" error={"The path #{@props.current_path} does not exist."} />
when 'not_a_dir'
e = <ErrorDisplay title="Not a directory" error={"#{@props.current_path} is not a directory."} />
when 'not_running'
# This shouldn't happen, but due to maybe a slight race condition in the backend it can.
e = <ErrorDisplay title="Project still not running" error={"The project was not running when this directory listing was requested. Please try again in a moment."} />
when 'no_instance'
e = <ErrorDisplay title="Host down" error={"The host for this project is down, being rebooted, or is overloaded with users. Free projects are hosted on Google Pre-empt instances, which are rebooted at least once per day and periodically become unavailable. To increase the robustness of your projects, please become a paying customer (US $7/month) by entering your credit card in the Billing tab next to account settings, then email help@sagemath.com with links to the projects you want moved to a members only server."} />
else
Expand Down
2 changes: 2 additions & 0 deletions salvus/page/project_store.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,8 @@ class ProjectStore extends Store
return {error:'no_dir'}
else if listing.indexOf('ot a directory') != -1
return {error:'not_a_dir'}
else if listing.indexOf('not running') != -1 # yes, no underscore.
return {error:'not_running'}
else
return {error:listing}
if not listing?
Expand Down

0 comments on commit d1cbeac

Please sign in to comment.