Class DataTooLongException
The exception that is thrown when the supplied data does not fit in the QR code.
Inheritance
System.Object
System.Exception
System.SystemException
System.ArgumentException
DataTooLongException
Implements
System.Runtime.Serialization.ISerializable
Inherited Members
System.ArgumentException.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)
System.ArgumentException.Message
System.ArgumentException.ParamName
System.Exception.GetBaseException()
System.Exception.GetType()
System.Exception.ToString()
System.Exception.Data
System.Exception.HelpLink
System.Exception.HResult
System.Exception.InnerException
System.Exception.Source
System.Exception.StackTrace
System.Exception.TargetSite
System.Exception.SerializeObjectState
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Net.Codecrete.QrCodeGenerator
Assembly: QrCodeGenerator.dll
Syntax
public class DataTooLongException : ArgumentException, ISerializable
Remarks
Ways to handle this exception include:
- Decrease the error correction level (if it was greater than Low)
- Increase the
maxVersion
argument (if it was less than MaxVersion). This advice applies to the advanced factory functions EncodeSegments(List<QrSegment>, QrCode.Ecc, Int32, Int32, Int32, Boolean) and MakeSegmentsOptimally(String, QrCode.Ecc, Int32, Int32) only. Other factory functions automatically try all versions up to MaxVersion. - Split the text into several segments and encode them using different encoding modes (see MakeSegmentsOptimally(String, QrCode.Ecc, Int32, Int32).)
- Make the text or binary data shorter.
- Change the text to fit the character set of a particular segment mode (e.g. alphanumeric).
- Reject the data and notify the caller/user.
Constructors
| Improve this Doc View SourceDataTooLongException(String)
Initializes a new instance of the DataTooLongException class.
Declaration
public DataTooLongException(string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message that describes the error. |
Implements
System.Runtime.Serialization.ISerializable