feat: slightly more expressive exception message
More datails in exception during header parsing.
This commit is contained in:
		@@ -115,7 +115,7 @@ namespace ArStomp
 | 
			
		||||
				var colon = line.IndexOf(":");
 | 
			
		||||
				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 value = line.Substring(colon + 1);
 | 
			
		||||
 
 | 
			
		||||
@@ -286,15 +286,8 @@ namespace ArStomp
 | 
			
		||||
			var ct = Token.Token;
 | 
			
		||||
			try
 | 
			
		||||
			{
 | 
			
		||||
				Frame fr = null;
 | 
			
		||||
				try
 | 
			
		||||
				{
 | 
			
		||||
					fr = Helpers.GetFrame(msg.RawData, ct);
 | 
			
		||||
				}
 | 
			
		||||
				catch (Exception e)
 | 
			
		||||
				{
 | 
			
		||||
					throw e;
 | 
			
		||||
				}
 | 
			
		||||
				Frame fr = Helpers.GetFrame(msg.RawData, ct);
 | 
			
		||||
 | 
			
		||||
				if (fr.Type == FrameType.Error) ExpectFrame(fr, FrameType.Message);
 | 
			
		||||
				if (fr.Type == FrameType.Message)
 | 
			
		||||
				{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user