Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo-1
Commits
5e0d4b9e
Unverified
Commit
5e0d4b9e
authored
Oct 07, 2018
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
#12515 异常处理
parent
808e23ba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
31 deletions
+22
-31
src/main/java/org/b3log/solo/SoloServletListener.java
src/main/java/org/b3log/solo/SoloServletListener.java
+4
-3
src/main/java/org/b3log/solo/model/Option.java
src/main/java/org/b3log/solo/model/Option.java
+16
-23
src/main/java/org/b3log/solo/service/ArticleQueryService.java
...main/java/org/b3log/solo/service/ArticleQueryService.java
+2
-5
No files found.
src/main/java/org/b3log/solo/SoloServletListener.java
View file @
5e0d4b9e
...
...
@@ -187,7 +187,7 @@ public final class SoloServletListener extends AbstractServletListener {
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
e
.
getMessage
(),
e
);
throw
new
IllegalStateException
(
e
);
System
.
exit
(-
1
);
}
Stopwatchs
.
end
();
...
...
@@ -216,8 +216,9 @@ public final class SoloServletListener extends AbstractServletListener {
final
B3CommentSender
commentSender
=
beanManager
.
getReference
(
B3CommentSender
.
class
);
eventManager
.
registerListener
(
commentSender
);
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Register event handlers error"
,
e
);
throw
new
IllegalStateException
(
e
);
LOGGER
.
log
(
Level
.
ERROR
,
"Register event handlers failed"
,
e
);
System
.
exit
(-
1
);
}
LOGGER
.
debug
(
"Registered event handlers"
);
...
...
src/main/java/org/b3log/solo/model/Option.java
View file @
5e0d4b9e
...
...
@@ -19,7 +19,6 @@ package org.b3log.solo.model;
import
org.apache.commons.lang.StringUtils
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.logging.Level
;
import
org.b3log.latke.logging.Logger
;
import
org.json.JSONArray
;
import
org.json.JSONObject
;
...
...
@@ -30,7 +29,7 @@ import java.util.Set;
* This class defines option model relevant keys.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.3.0.
9, Sep 21
, 2018
* @version 1.3.0.
10, Oct 7
, 2018
* @since 0.6.0
*/
public
final
class
Option
{
...
...
@@ -526,28 +525,22 @@ public final class Option {
final
JSONArray
signs
=
new
JSONArray
();
final
int
signLength
=
4
;
try
{
for
(
int
i
=
0
;
i
<
signLength
;
i
++)
{
final
JSONObject
sign
=
new
JSONObject
();
sign
.
put
(
Keys
.
OBJECT_ID
,
i
);
signs
.
put
(
sign
);
sign
.
put
(
Sign
.
SIGN_HTML
,
""
);
}
// Sign(id=0) is the 'empty' sign, used for article user needn't a sign
DEFAULT_SIGNS
=
signs
.
toString
();
final
JSONObject
replyNotificationTemplate
=
new
JSONObject
();
replyNotificationTemplate
.
put
(
"subject"
,
"${blogTitle}: New reply of your comment"
);
replyNotificationTemplate
.
put
(
"body"
,
"Your comment on post[<a href='${postLink}'>"
+
"${postTitle}</a>] received an reply: <p>${replier}"
+
": <span><a href='${replyURL}'>${replyContent}</a></span></p>"
);
DEFAULT_REPLY_NOTIFICATION_TEMPLATE
=
replyNotificationTemplate
.
toString
();
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Creates sign error!"
,
e
);
throw
new
IllegalStateException
(
e
);
for
(
int
i
=
0
;
i
<
signLength
;
i
++)
{
final
JSONObject
sign
=
new
JSONObject
();
sign
.
put
(
Keys
.
OBJECT_ID
,
i
);
signs
.
put
(
sign
);
sign
.
put
(
Sign
.
SIGN_HTML
,
""
);
}
// Sign(id=0) is the 'empty' sign, used for article user needn't a sign
DEFAULT_SIGNS
=
signs
.
toString
();
final
JSONObject
replyNotificationTemplate
=
new
JSONObject
();
replyNotificationTemplate
.
put
(
"subject"
,
"${blogTitle}: New reply of your comment"
);
replyNotificationTemplate
.
put
(
"body"
,
"Your comment on post[<a href='${postLink}'>"
+
"${postTitle}</a>] received an reply: <p>${replier}"
+
": <span><a href='${replyURL}'>${replyContent}</a></span></p>"
);
DEFAULT_REPLY_NOTIFICATION_TEMPLATE
=
replyNotificationTemplate
.
toString
();
}
/**
...
...
src/main/java/org/b3log/solo/service/ArticleQueryService.java
View file @
5e0d4b9e
...
...
@@ -53,7 +53,7 @@ import static org.b3log.solo.model.Article.*;
* @author <a href="http://blog.sweelia.com">ArmstrongCN</a>
* @author <a href="http://zephyr.b3log.org">Zephyr</a>
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.3.2.
5, Oct 5
, 2018
* @version 1.3.2.
6, Oct 7
, 2018
* @since 0.3.5
*/
@Service
...
...
@@ -359,10 +359,7 @@ public class ArticleQueryService {
}
}
LOGGER
.
log
(
Level
.
WARN
,
"Can not find the sign[id={0}], returns a default sign[id=1]"
,
signId
);
if
(
null
==
defaultSign
)
{
throw
new
IllegalStateException
(
"Can not find the default sign which id equals to 1"
);
}
LOGGER
.
log
(
Level
.
WARN
,
"Can not find the sign [id={0}], returns a default sign [id=1]"
,
signId
);
return
defaultSign
;
}
...
...
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