Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
texjs-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Mehren
texjs-web
Commits
70bd3baf
Verified
Commit
70bd3baf
authored
7 years ago
by
Shane Kilkelly
Committed by
David Mehren
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use errors from ProjectFileAgent
parent
8e0b1149
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/coffee/Features/LinkedFiles/ProjectFileAgent.coffee
+6
-2
6 additions, 2 deletions
app/coffee/Features/LinkedFiles/ProjectFileAgent.coffee
app/coffee/Features/LinkedFiles/ProjectOutputFileAgent.coffee
+2
-18
2 additions, 18 deletions
...coffee/Features/LinkedFiles/ProjectOutputFileAgent.coffee
with
8 additions
and
20 deletions
app/coffee/Features/LinkedFiles/ProjectFileAgent.coffee
+
6
−
2
View file @
70bd3baf
...
@@ -58,9 +58,12 @@ SourceFileNotFoundError = (message) ->
...
@@ -58,9 +58,12 @@ SourceFileNotFoundError = (message) ->
SourceFileNotFoundError
.
prototype
.
__proto__
=
Error
.
prototype
SourceFileNotFoundError
.
prototype
.
__proto__
=
Error
.
prototype
module
.
exports
=
ProjectFileAgent
=
module
.
exports
=
ProjectFileAgent
=
{
V1ProjectNotFoundError
:
V1ProjectNotFoundError
V1ProjectNotFoundError
BadDataError
ProjectNotFoundError
V1ProjectNotFoundError
_v1ProjectNotFoundMessage
:
"Sorry, the source project is not yet imported to Overleaf v2. Please import it to Overleaf v2 to refresh this file"
_v1ProjectNotFoundMessage
:
"Sorry, the source project is not yet imported to Overleaf v2. Please import it to Overleaf v2 to refresh this file"
...
@@ -163,3 +166,4 @@ module.exports = ProjectFileAgent =
...
@@ -163,3 +166,4 @@ module.exports = ProjectFileAgent =
else
else
next
(
error
)
next
(
error
)
next
()
next
()
}
This diff is collapsed.
Click to expand it.
app/coffee/Features/LinkedFiles/ProjectOutputFileAgent.coffee
+
2
−
18
View file @
70bd3baf
...
@@ -11,22 +11,6 @@ _ = require "underscore"
...
@@ -11,22 +11,6 @@ _ = require "underscore"
request
=
require
"request"
request
=
require
"request"
BadDataError
=
(
message
)
->
error
=
new
Error
(
message
)
error
.
name
=
'BadData'
error
.
__proto__
=
BadDataError
.
prototype
return
error
BadDataError
.
prototype
.
__proto__
=
Error
.
prototype
ProjectNotFoundError
=
(
message
)
->
error
=
new
Error
(
message
)
error
.
name
=
'ProjectNotFound'
error
.
__proto__
=
ProjectNotFoundError
.
prototype
return
error
ProjectNotFoundError
.
prototype
.
__proto__
=
Error
.
prototype
OutputFileFetchFailedError
=
(
message
)
->
OutputFileFetchFailedError
=
(
message
)
->
error
=
new
Error
(
message
)
error
=
new
Error
(
message
)
error
.
name
=
'OutputFileFetchFailedError'
error
.
name
=
'OutputFileFetchFailedError'
...
@@ -92,11 +76,11 @@ module.exports = ProjectOutputFileAgent = {
...
@@ -92,11 +76,11 @@ module.exports = ProjectOutputFileAgent = {
callback
(
error
)
callback
(
error
)
handleError
:
(
error
,
req
,
res
,
next
)
->
handleError
:
(
error
,
req
,
res
,
next
)
->
if
error
instanceof
BadDataError
if
error
instanceof
ProjectFileAgent
.
BadDataError
res
.
status
(
400
).
send
(
"The submitted data is not valid"
)
res
.
status
(
400
).
send
(
"The submitted data is not valid"
)
else
if
error
instanceof
OutputFileFetchFailedError
else
if
error
instanceof
OutputFileFetchFailedError
res
.
status
(
404
).
send
(
"Could not get output file"
)
res
.
status
(
404
).
send
(
"Could not get output file"
)
else
if
error
instanceof
ProjectNotFoundError
else
if
error
instanceof
ProjectFileAgent
.
ProjectNotFoundError
res
.
status
(
404
).
send
(
"Project not found"
)
res
.
status
(
404
).
send
(
"Project not found"
)
else
if
error
instanceof
ProjectFileAgent
.
V1ProjectNotFoundError
else
if
error
instanceof
ProjectFileAgent
.
V1ProjectNotFoundError
res
.
status
(
409
).
send
(
ProjectFileAgent
.
_v1ProjectNotFoundMessage
)
res
.
status
(
409
).
send
(
ProjectFileAgent
.
_v1ProjectNotFoundMessage
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment