elek / docker-storj-extension

Highly experimental docker-desktop extension to pull/push from/to Storj DCS
Apache License 2.0
5 stars 1 forks source link

Generic error handling in frontend #3

Closed elek closed 1 year ago

elek commented 2 years ago

Some frontend pages already have a lightweight error handling. Like in Push.vue:

var push = function(name, tag) {
  error.value = ""
  message.value = ""
  Api.push(name, tag).then(function () {
    message.value = "Container has been pushed successfully"
  }, function (e) {
    error.value = e.response.data.error
  })
}

And the render:

  <p class="alert alert-danger" role="alert" v-if="error">{{ error }}</p>
  <p class="alert alert-success" role="alert" v-if="message" v-html="message"></p>

Would be nice to make it more generic: in case of any HTTP request the failure should be written out to warn the user, that sg. is wrong.

gagandeepp commented 2 years ago

interested please assign @elek

elek commented 1 year ago

done