Output a clearer error message when publishing to an unregistered app #569
Labels
💗 enhancement
New feature or request
🔰 good first issue
Good for newcomers
🐇 quick
Low effort to implement / fix — a few hours at most
Summary
When attempting to publish to an app that hasn't been registered, the error message should reflect this fact.
Problem
While setting up a new project, I created
fission.yaml
by hand, and manually entered my desired url. When I published the app, I received the following output:$ fission app publish 🕛🛫 App publish local preflight 🕑✈️ Pushing to remotePeer List... 🚫 Server unable to sync data
I thought that perhaps the app wasn't being registered automatically, so I tried to register it, and the output suggested that the registration did in fact exist.
$ fission app register --name some-name App already set up at some-name.fission.app
Publishing again, in verbose mode, made it clear that the app was unregistered:
Impact
The current error message suggested an issue with my IPFS configuration, so I deleted everything and tried again from scratch. My next guess was an availability issue with the remote peers, which might drive a new user to table Fission and assume it isn't ready for use.
Right now, there aren't many reasons to create a
fission.yaml
outside of the regularfission app register
flow, but I can imagine this failure case becoming more common as the configuration options available grow in number and complexity. For example, someone may wish to copy their existingfission.yaml
from another project, in order to copy environment config as described in #567. Similarly, you may begin to see templating tools that scaffold out Webnative applications, and this is a caveat they'd need to be aware of.Solution
Since the response from the server is already a 404, this just needs to be translated to a human readable error. Perhaps:
Requiring that the user delete their
fission.yaml
isn't a great experience, so it may also be worth supporting a--force
flag forfission app register
, that registers an app with the name part of the URL infission.yaml
. Then the error message could be adjusted to:The text was updated successfully, but these errors were encountered: