Skip to content

Commit

Permalink
#172 added error message
Browse files Browse the repository at this point in the history
  • Loading branch information
sunil committed Oct 27, 2024
1 parent f1d0592 commit fc5a28d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions js/pages/detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ class cDetail {
{
const oThis = this
bean.on(oHttp, 'result', poHttp => oThis.onNextProduct(poHttp))
bean.on(oHttp, 'error', poHttp => oThis.onNextError(poHttp))
oHttp.fetch_json(sUrl)
}
}
Expand All @@ -654,6 +655,7 @@ class cDetail {
{
const oThis = this
bean.on(oHttp, 'result', poHttp => oThis.onNextImage(poHttp))
bean.on(oHttp, 'error', poHttp => oThis.onNextError(poHttp))
oHttp.fetch_json(sUrl)
}
}
Expand Down Expand Up @@ -691,6 +693,13 @@ class cDetail {
//# Event Handlers
//###############################################################

static onNextError(poHttp) {
const oContainer = cJquery.element(cDetailPageConstants.IMAGE_ID)
oContainer.empty()
const oErrorDiv = cRender.errorbox('error retrieving image - press reload for previous image')
oContainer.append(oErrorDiv)
}

//***************************************************************
static onNextProduct(poHttp) {
const oData = poHttp.response
Expand Down Expand Up @@ -823,8 +832,6 @@ class cDetail {
}
}

//***************************************************************
static pr_populate_image() {}
//***************************************************************
static pr_update_msl(oData) {
const sDump = cDebug.getvardump(oData, 1)
Expand Down

0 comments on commit fc5a28d

Please sign in to comment.