vmware-archive / dispatch

Dispatch is a framework for deploying and managing serverless style applications.
http://dispatchframework.io
Apache License 2.0
532 stars 58 forks source link

Error handling incomplete for duplicate named functions #239

Open pandom opened 6 years ago

pandom commented 6 years ago

Detailed Description

When creating a function that has the same name as an existing function the following error is surfaced.

Action:

dispatch create --file seed.yaml
[Code: 400] Bad request: store error when adding base image

Validate existing functions:

dispatch get functions
    NAME   |  IMAGE  | STATUS |         CREATED DATE
----------------------------------------------------------
  http-py  | python3 | READY  | Sat Jan  1 10:13:24 AEST 0000
  hello-py | python3 | READY  | Sat Jan  1 10:13:24 AEST 0000
  hello-js | nodejs6 | READY  | Sat Jan  1 10:13:24 AEST 0000

Check batch:

cat seed.yaml | grep http-py
name: http-py

The error ([Code: 400] Bad request: store error when adding base image) does not have any bearing on the actual error of unique function names.

Workaround: change name of function or delete existing named function. Validate: dispatch get functions

Context

The error does not indicate what is wrong or why the function import failed. A user will understand what the cause is and fix this.

Possible Implementation

Handle unique names to throw an error correction.

Complexity

Low due to known problem space - unique function names

Impact

Your Environment

pandom commented 6 years ago

This is related to #183 but when using -f seed.yml you recieve a 400 opposed to a 500.