mirror of
https://github.com/resume/resume.github.com.git
synced 2024-09-11 12:25:56 +03:00
Adds 404 handling
This commit is contained in:
parent
c5e49dd5f7
commit
e915614a2a
@ -98,11 +98,13 @@ var github_user_starred_resume = function(username, page) {
|
||||
error: function(e) {
|
||||
if (e.status == 403) {
|
||||
repos = 'api_limit'
|
||||
} else if (e.status == 404) {
|
||||
repos = 'not_found'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (repos === 'api_limit') {
|
||||
if (repos === 'api_limit' || repos === 'not_found') {
|
||||
return repos;
|
||||
}
|
||||
|
||||
@ -130,7 +132,7 @@ var run = function() {
|
||||
maxLanguages = 9,
|
||||
starred = github_user_starred_resume(username);
|
||||
|
||||
if (! starred || starred === 'api_limit') {
|
||||
if (! starred || starred === 'api_limit' || starred === 'not_found') {
|
||||
if (starred === 'api_limit') {
|
||||
$.ajax({
|
||||
url: 'views/api_limit.html',
|
||||
@ -140,6 +142,15 @@ var run = function() {
|
||||
$('#resume').html(data);
|
||||
}
|
||||
});
|
||||
} else if (starred === 'not_found') {
|
||||
$.ajax({
|
||||
url: 'views/not_found.html',
|
||||
dataType: 'html',
|
||||
success: function(data) {
|
||||
var template = data;
|
||||
$('#resume').html(data);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$.ajax({
|
||||
url: 'views/opt_out.html',
|
||||
|
10
views/not_found.html
Normal file
10
views/not_found.html
Normal file
@ -0,0 +1,10 @@
|
||||
<div id="doc" class="yui-t7">
|
||||
<div id="hd" role="banner"><h1>User Not Found</h1></div>
|
||||
<div id="bd" role="main">
|
||||
<div class="yui-g">
|
||||
<p>The user you requested was not found. Please check your spelling and try again.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ft" role="contentinfo"></div>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user