Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
马玮
/
carspider
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ca73ce60
authored
Aug 25, 2017
by
马玮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix try catch
parent
c7b520f9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
lib/spider/dealer/Autohome.js
+5
-1
No files found.
lib/spider/dealer/Autohome.js
View file @
ca73ce60
...
@@ -89,13 +89,14 @@ class Autohome extends Base {
...
@@ -89,13 +89,14 @@ class Autohome extends Base {
throw
new
errors
.
TryLoginError
(
'登录失效'
);
throw
new
errors
.
TryLoginError
(
'登录失效'
);
}
}
}
catch
(
e
)
{
}
catch
(
e
)
{
throw
new
errors
.
TryLoginError
(
e
);
}
}
}
}
async
login
()
{
async
login
()
{
// 随机返回登录状态
// 随机返回登录状态
// return [new errors.LoginError('登录失败'), randomInt(0, 1)];
// return [new errors.LoginError('登录失败'), randomInt(0, 1)];
try
{
logger
.
info
(
'开始表单登录'
);
logger
.
info
(
'开始表单登录'
);
const
username
=
this
.
params
.
username
;
const
username
=
this
.
params
.
username
;
...
@@ -168,6 +169,9 @@ class Autohome extends Base {
...
@@ -168,6 +169,9 @@ class Autohome extends Base {
}
else
{
}
else
{
throw
new
errors
.
LoginError
(
'登录失败'
);
throw
new
errors
.
LoginError
(
'登录失败'
);
}
}
}
catch
(
e
)
{
throw
new
errors
.
LoginError
(
e
);
}
}
}
// 抓取线索
// 抓取线索
...
...
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