Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
AURA
dashboard
Commits
d3701a6b
Commit
d3701a6b
authored
Jun 07, 2019
by
jackie / Andrea Ida Malkah Klaura
Browse files
FEAT: add error notification for failed imports
parent
a3147fc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/components/FileManager.vue
View file @
d3701a6b
...
@@ -248,7 +248,8 @@
...
@@ -248,7 +248,8 @@
slot=
"metadata.album"
slot=
"metadata.album"
slot-scope=
"data"
slot-scope=
"data"
>
>
<span
v-if=
"data.item.source.import.state !== 'done'"
><img
<span
v-if=
"data.item.source.import.state === 'aborted'"
><b-badge
variant=
"danger"
>
Error:
</b-badge></span>
<span
v-else-if=
"data.item.source.import.state !== 'done'"
><img
src=
"../assets/radio.gif"
src=
"../assets/radio.gif"
width=
"24"
width=
"24"
alt=
"loading data"
alt=
"loading data"
...
@@ -266,6 +267,7 @@
...
@@ -266,6 +267,7 @@
slot-scope=
"data"
slot-scope=
"data"
>
>
<span
v-if=
"data.item.source.import.state === 'done'"
>
{{
data
.
value
}}
</span>
<span
v-if=
"data.item.source.import.state === 'done'"
>
{{
data
.
value
}}
</span>
<span
v-else-if=
"data.item.source.import.state === 'aborted'"
>
import was aborted
</span>
<span
v-else-if=
"data.item.source.import.progress !== undefined"
>
{{
data
.
item
.
source
.
import
.
progress
.
step
}}
:
</span>
<span
v-else-if=
"data.item.source.import.progress !== undefined"
>
{{
data
.
item
.
source
.
import
.
progress
.
step
}}
:
</span>
</
template
>
</
template
>
...
@@ -281,6 +283,10 @@
...
@@ -281,6 +283,10 @@
<div
v-if=
"data.item.source.import.state === 'done'"
>
<div
v-if=
"data.item.source.import.state === 'done'"
>
{{
prettyNanoseconds
(
data
.
value
)
}}
{{
prettyNanoseconds
(
data
.
value
)
}}
</div>
</div>
<!-- If the import was aborted show some error info -->
<div
v-else-if=
"data.item.source.import.state === 'aborted'"
>
{{
data
.
item
.
source
.
import
.
error
}}
</div>
<!-- Or print the progress for ongoing imports. We use the variant
<!-- Or print the progress for ongoing imports. We use the variant
prop of the b-progress to display the bar in different colours -
prop of the b-progress to display the bar in different colours -
either the info variant for the fetching phase or the success
either the info variant for the fetching phase or the success
...
@@ -1138,9 +1144,23 @@ export default {
...
@@ -1138,9 +1144,23 @@ export default {
// ideally we should refine this so that every single file gets updated independently)
// ideally we should refine this so that every single file gets updated independently)
//this.uploadInterval = setInterval(() => { this.fetchImports(this.shows[this.currentShow].slug) }, 100)
//this.uploadInterval = setInterval(() => { this.fetchImports(this.shows[this.currentShow].slug) }, 100)
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
if
(
error
.
response
.
status
===
500
&&
error
.
response
.
data
.
error
===
'
ffmpeg returned 1
'
)
{
this
.
$log
.
error
(
error
.
response
)
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
alert
(
'
Error: could not start the file upload. See console for details.
'
)
this
.
$log
.
error
(
error
.
response
)
// if we use a file format that is not supported by ffmpeg, we should find
// the second to last line should notify us about invalid data
let
ffmpegError
=
error
.
response
.
data
.
detail
[
error
.
response
.
data
.
detail
.
length
-
2
]
if
(
ffmpegError
.
line
===
'
pipe:: Invalid data found when processing input
'
)
{
// in this case we can make the error message in the files table more specific
alert
(
'
Error: import aborted. The audio data format of your file is not valid!
'
)
}
else
{
alert
(
'
Error: ffmpeg could not processs your file! See console for details.
'
)
}
}
else
{
this
.
$log
.
error
(
error
.
response
.
status
+
'
'
+
error
.
response
.
statusText
)
this
.
$log
.
error
(
error
.
response
)
alert
(
'
Error: could not finish the file upload/import. See console for details.
'
)
}
})
})
},
},
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment