feat: slightly more expressive exception message
More datails in exception during header parsing.
This commit is contained in:
parent
a15c0c2a87
commit
8b7d743dad
@ -115,7 +115,7 @@ namespace ArStomp
|
|||||||
var colon = line.IndexOf(":");
|
var colon = line.IndexOf(":");
|
||||||
if (colon < 1) // must exist and cannot by first character in the line
|
if (colon < 1) // must exist and cannot by first character in the line
|
||||||
{
|
{
|
||||||
throw new Exception("Cannot parse header");
|
throw new Exception($"Cannot parse header: colon not found. Cmd: {cmd}, line: `${line}`");
|
||||||
}
|
}
|
||||||
var key = line.Substring(0, colon);
|
var key = line.Substring(0, colon);
|
||||||
var value = line.Substring(colon + 1);
|
var value = line.Substring(colon + 1);
|
||||||
|
@ -286,15 +286,8 @@ namespace ArStomp
|
|||||||
var ct = Token.Token;
|
var ct = Token.Token;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Frame fr = null;
|
Frame fr = Helpers.GetFrame(msg.RawData, ct);
|
||||||
try
|
|
||||||
{
|
|
||||||
fr = Helpers.GetFrame(msg.RawData, ct);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
if (fr.Type == FrameType.Error) ExpectFrame(fr, FrameType.Message);
|
if (fr.Type == FrameType.Error) ExpectFrame(fr, FrameType.Message);
|
||||||
if (fr.Type == FrameType.Message)
|
if (fr.Type == FrameType.Message)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user