mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-20 19:57:44 +02:00
Handle simple error thrown by js
This commit is contained in:
parent
8bfd812c70
commit
326866e1c7
@ -19,9 +19,9 @@
|
|||||||
<p>{{ $t('errors.error_occured') }}</p>
|
<p>{{ $t('errors.error_occured') }}</p>
|
||||||
<p v-if="error" class="has-text-grey-lighter">{{ error.statusText }}</p>
|
<p v-if="error" class="has-text-grey-lighter">{{ error.statusText }}</p>
|
||||||
<p>{{ $t('errors.please') }}<router-link :to="{ name: 'accounts' }" class="is-text has-text-grey-light">{{ $t('errors.refresh') }}</router-link></p>
|
<p>{{ $t('errors.please') }}<router-link :to="{ name: 'accounts' }" class="is-text has-text-grey-light">{{ $t('errors.refresh') }}</router-link></p>
|
||||||
<p v-if="debugMode == 'development' && error.data">
|
<p v-if="debugMode == 'development' && error">
|
||||||
<strong>{{ error.data.message }}</strong><br>
|
<strong>{{ error.message }}</strong><br>
|
||||||
{{ error.data.debug }}
|
{{ error.debug }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</modal>
|
</modal>
|
||||||
@ -40,12 +40,30 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
|
||||||
debugMode: function() {
|
debugMode: function() {
|
||||||
return process.env.NODE_ENV
|
return process.env.NODE_ENV
|
||||||
},
|
},
|
||||||
|
|
||||||
error: function() {
|
error: function() {
|
||||||
return this.err === undefined ? {} : this.err
|
if( this.err === undefined ) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(this.err.data) {
|
||||||
|
return this.err.data
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
statusText: this.err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
props: ['err'], // error.response
|
props: ['err'], // error.response
|
||||||
|
Loading…
x
Reference in New Issue
Block a user