CodingSouls团队项目冲刺-个人概况(9)
团队冲刺第九天:
实现报错功能
- error.ejs
- 当操作不符合规定时便会报错
<% this.title = '错误' %>
<% include header %>
<%
if (!(err instanceof ErrorMessage)) {
err = new ErrorMessage(err.toString());
}
%>
<div class="ui negative icon message">
<i class="remove icon"></i>
<div class="content">
<div class="header" style="margin-bottom: 10px; ">
<%= err.message %>
</div>
<% if (err.details) { %>
<p><%= err.details %></p>
<% } %>
<p>
<% for (let text in err.nextUrls) { %>
<a href="<%= err.nextUrls[text] %>" style="margin-right: 5px; "><%= text %></a>
<% } %>
<a href="javascript:history.go(-1)">返回上一页</a>
</p>
</div>
</div>
<% include footer %>
未完待续。。。