removed (Exception) from catches, added -readme/-guide command

This commit is contained in:
Master Kwoth
2016-02-14 16:48:46 +01:00
parent ba34a84391
commit 23aee061cd
11 changed files with 34 additions and 29 deletions

View File

@ -192,7 +192,7 @@ namespace NadekoBot.Classes.Music {
try {
p.CancelOutputRead();
p.Close();
} catch (Exception) { }
} catch { }
Console.WriteLine("Buffering canceled, stream is completed.");
return;
}
@ -221,7 +221,7 @@ namespace NadekoBot.Classes.Music {
try {
p.CancelOutputRead();
p.Close();
} catch (Exception) { }
} catch { }
Console.WriteLine($"Didn't read anything from the stream for {attempt} attempts. {buffer.Length/1.MB()}MB length");
return;

View File

@ -89,7 +89,7 @@ namespace NadekoBot
ConnectedServers = connectedServers,
DateAdded = DateTime.Now
});
} catch (Exception) {
} catch {
Console.WriteLine("DB Exception in stats collecting.");
break;
}
@ -110,7 +110,7 @@ namespace NadekoBot
CommandName = e.Command.Text,
DateAdded = DateTime.Now
});
} catch (Exception) {
} catch {
Console.WriteLine("Parse error in ran command.");
}
}

View File

@ -47,7 +47,7 @@ namespace NadekoBot.Classes {
rq = new RestSharp.RestRequest("anime/" + smallObj["id"]);
rq.AddParameter("access_token", token);
return await Task.Run(() => JsonConvert.DeserializeObject<AnimeResult>(cl.Execute(rq).Content));
} catch (Exception) {
} catch {
return null;
}
}
@ -174,7 +174,7 @@ namespace NadekoBot.Classes {
var matches = Regex.Matches(webpage, "data-large-file-url=\"(?<id>.*?)\"");
return await $"http://danbooru.donmai.us{ matches[rng.Next(0, matches.Count)].Groups["id"].Value }".ShortenUrl();
} catch (Exception) {
} catch {
return null;
}
}
@ -190,7 +190,7 @@ namespace NadekoBot.Classes {
//now extract the image from post page
var match = Regex.Match(webpage, "\"(?<url>http://simg4.gelbooru.com//images.*?)\"");
return match.Groups["url"].Value;
} catch (Exception) {
} catch {
return null;
}
}