diff --git a/OSLC4Net_SDK/OSLC4Net.Core/Model/OccursExtension.cs b/OSLC4Net_SDK/OSLC4Net.Core/Model/OccursExtension.cs index b45d88a5..ad7c89ff 100644 --- a/OSLC4Net_SDK/OSLC4Net.Core/Model/OccursExtension.cs +++ b/OSLC4Net_SDK/OSLC4Net.Core/Model/OccursExtension.cs @@ -32,7 +32,7 @@ public static Occurs FromString(string value) } } - throw new ArgumentException(); + throw new ArgumentException($"Invalid string representation of Occurs value: {value}", nameof(value)); } public static Occurs FromURI(URI uri) diff --git a/OSLC4Net_SDK/OSLC4Net.Core/Model/RepresentationExtension.cs b/OSLC4Net_SDK/OSLC4Net.Core/Model/RepresentationExtension.cs index d83f2b56..e1e83629 100644 --- a/OSLC4Net_SDK/OSLC4Net.Core/Model/RepresentationExtension.cs +++ b/OSLC4Net_SDK/OSLC4Net.Core/Model/RepresentationExtension.cs @@ -32,7 +32,7 @@ public static Representation FromString(string value) } } - throw new ArgumentException(); + throw new ArgumentException($"Invalid string representation of Representation value: {value}", nameof(value)); } public static Representation FromURI(URI uri) diff --git a/OSLC4Net_SDK/OSLC4Net.Server.Providers/OslcRdfInputFormatter.cs b/OSLC4Net_SDK/OSLC4Net.Server.Providers/OslcRdfInputFormatter.cs index 92fece80..5699341a 100644 --- a/OSLC4Net_SDK/OSLC4Net.Server.Providers/OslcRdfInputFormatter.cs +++ b/OSLC4Net_SDK/OSLC4Net.Server.Providers/OslcRdfInputFormatter.cs @@ -48,8 +48,7 @@ public override async Task ReadRequestBodyAsync( OslcMediaType.TEXT_TURTLE => RdfFormat.Turtle, OslcMediaType.APPLICATION_NTRIPLES => RdfFormat.NTriples, OslcMediaType.APPLICATION_JSON_LD => RdfFormat.JsonLd, - _ => throw new ArgumentOutOfRangeException(nameof(requestedType), - "Unknown RDF format"), + _ => throw new NotSupportedException($"Unknown RDF format: {requestedType}"), }; using var reader = new StreamReader(context.HttpContext.Request.Body, encoding); diff --git a/OSLC4Net_SDK/OSLC4Net.Server.Providers/OslcRdfOutputFormatter.cs b/OSLC4Net_SDK/OSLC4Net.Server.Providers/OslcRdfOutputFormatter.cs index a6cfbb14..159bdc73 100644 --- a/OSLC4Net_SDK/OSLC4Net.Server.Providers/OslcRdfOutputFormatter.cs +++ b/OSLC4Net_SDK/OSLC4Net.Server.Providers/OslcRdfOutputFormatter.cs @@ -61,8 +61,7 @@ public override async Task WriteResponseBodyAsync(OutputFormatterWriteContext co OslcMediaType.TEXT_TURTLE => RdfFormat.Turtle, OslcMediaType.APPLICATION_NTRIPLES => RdfFormat.NTriples, OslcMediaType.APPLICATION_JSON_LD => RdfFormat.JsonLd, - _ => throw new ArgumentOutOfRangeException(nameof(requestedType), - "Unknown RDF format"), + _ => throw new NotSupportedException($"Unknown RDF format: {requestedType}"), }, Graph = graph };