Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a bit of error handling.

  • Loading branch information...
commit ddd032a52cb48d5712795a8e8f80b971f075312b 1 parent c046773
@a-fung authored
View
8 source/haxe/afung/mangaWeb3/server/Manga.hx
@@ -726,7 +726,13 @@ class Manga
if (!FileSystem.exists(outputPath))
{
var lockFile:Dynamic;
- lockFile = untyped __call__("@fopen", lockPath, "x");
+ try
+ {
+ lockFile = untyped __call__("@fopen", lockPath, "x");
+ }
+ catch (ex:Dynamic)
+ {
+ }
if (lockFile != false)
{
View
17 source/scriptsharp/Module/ReadModule.cs
@@ -469,12 +469,17 @@ private void LoadNextPage()
MangaPage page = loadQueue.Dequeue();
LoadingPage = true;
- page.Load(delegate
- {
- LoadingPage = false;
- LoadNextPage();
- RefreshMangaArea();
- });
+ page.Load(
+ delegate
+ {
+ LoadingPage = false;
+ LoadNextPage();
+ RefreshMangaArea();
+ },
+ delegate
+ {
+ Exit();
+ });
}
private void UnloadPage(int page)
View
4 source/scriptsharp/Widget/MangaListItem.cs
@@ -146,6 +146,10 @@ private void CoverRequestSuccess(MangaImageResponse response)
},
coverRequestDelay = Math.Round(coverRequestDelay * 1.1));
}
+ else if (response.status == 2)
+ {
+ attachedObject.Remove();
+ }
}
private void LoadCover(string coverUrl)
View
7 source/scriptsharp/Widget/MangaPage.cs
@@ -20,6 +20,7 @@ public class MangaPage
private bool ltr;
private int totalPages;
private Action onload;
+ private Action onfailure;
private jQueryObject imageObject;
private jQueryObject imagePart1Object;
private jQueryObject imagePart2Object;
@@ -116,7 +117,7 @@ public MangaPage(int mangaId, int page, int width, int height, bool ltr, int tot
unloaded = loading = loaded = false;
}
- public void Load(Action onload)
+ public void Load(Action onload, Action onfailure)
{
if (loaded)
{
@@ -125,6 +126,7 @@ public void Load(Action onload)
}
this.onload = onload;
+ this.onfailure = onfailure;
loading = true;
@@ -180,6 +182,7 @@ private void MangaPageRequestSucess(MangaImageResponse response)
else
{
ErrorModal.ShowError(Strings.Get("MangaNotAvailable"));
+ onfailure();
}
}
@@ -221,6 +224,7 @@ private void MangaPagePart1RequestSucess(MangaImageResponse response)
else
{
ErrorModal.ShowError(Strings.Get("MangaNotAvailable"));
+ onfailure();
}
}
@@ -261,6 +265,7 @@ private void MangaPagePart2RequestSucess(MangaImageResponse response)
else
{
ErrorModal.ShowError(Strings.Get("MangaNotAvailable"));
+ onfailure();
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.