mirror of
https://github.com/sochix/TLSharp.git
synced 2025-12-06 08:02:00 +01:00
Merge pull request #263 from knocte/improveExceptions
Always include an innerException when re-throwing
This commit is contained in:
commit
0a227b8412
|
|
@ -488,7 +488,7 @@ namespace TLSharp.Core.Network
|
||||||
internal int DC { get; private set; }
|
internal int DC { get; private set; }
|
||||||
|
|
||||||
internal MigrationNeededException(int dc)
|
internal MigrationNeededException(int dc)
|
||||||
: base ("$Your phone number is registered to a different dc: {dc}. Please migrate.")
|
: base ($"Your phone number is registered to a different DC: {dc}. Please migrate.")
|
||||||
{
|
{
|
||||||
DC = dc;
|
DC = dc;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,9 +49,10 @@ namespace TLSharp.Tests
|
||||||
{
|
{
|
||||||
return new TelegramClient(ApiId, ApiHash);
|
return new TelegramClient(ApiId, ApiHash);
|
||||||
}
|
}
|
||||||
catch (MissingApiConfigurationException)
|
catch (MissingApiConfigurationException ex)
|
||||||
{
|
{
|
||||||
throw new Exception($"Please add your API settings to the `app.config` file. (More info: {MissingApiConfigurationException.InfoUrl})");
|
throw new Exception($"Please add your API settings to the `app.config` file. (More info: {MissingApiConfigurationException.InfoUrl})",
|
||||||
|
ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace TeleSharp.TL
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
throw new InvalidDataException("Constructor Invalid Or Context.Init Not Called !");
|
throw new InvalidDataException("Constructor Invalid Or Context.Init Not Called !", ex);
|
||||||
}
|
}
|
||||||
if (t.IsSubclassOf(typeof(TLMethod)))
|
if (t.IsSubclassOf(typeof(TLMethod)))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue