Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
LINAGORA
L
LGS
Labs
linstt-controller
Commits
efa73fde
Commit
efa73fde
authored
Jan 19, 2018
by
Yoann HOUPERT
Browse files
manage error response
parent
336d380c
Pipeline
#10054
passed with stage
in 2 minutes and 41 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
lib/webserver/routes.js
lib/webserver/routes.js
+4
-2
No files found.
lib/webserver/routes.js
View file @
efa73fde
...
...
@@ -60,7 +60,7 @@ const routesFactory = config => {
// Default Offline
const
transcription
=
json
.
transcript
;
// TODO use this when enhancement whill be integrate
// const transcription = JSON.parse(json.transcript)
// const transcription = JSON.parse(json.transcript)
.transcript
const
jsonResponse
=
{
status
:
0
,
...
...
@@ -74,8 +74,10 @@ const routesFactory = config => {
});
}
else
{
stt
.
transcript
(
body
,
(
err
,
response
,
body
)
=>
{
if
(
err
||
response
===
undefined
||
body
===
undefined
||
response
.
statusCode
!==
successCode
)
{
if
(
err
)
{
return
res
.
status
(
interalServerCode
).
json
({
module
:
'
Online transcription
'
,
error
:
'
Error during audio transcription
'
,
info
:
err
.
toString
()});
}
else
if
(
response
===
undefined
||
body
===
undefined
||
response
.
statusCode
!==
successCode
)
{
return
res
.
status
(
interalServerCode
).
json
({
module
:
'
Online transcription
'
,
error
:
'
Error during audio transcription
'
});
}
else
if
(
body
.
indexOf
(
'
No workers available
'
)
!==
-
1
)
{
return
res
.
status
(
interalServerCode
).
json
({
module
:
'
Online transcription
'
,
error
:
'
No worker available for the moment.
'
});
}
...
...
Write
Preview
Markdown
is supported
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