Skip to content

Commit

Permalink
Move exception to seperate folder
Browse files Browse the repository at this point in the history
  • Loading branch information
inputfalken committed Sep 16, 2023
1 parent 8327ee8 commit 403d78d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using DynamoDBGenerator.Attributes;
using DynamoDBGenerator.Exceptions;
namespace DynamoDBGenerator.SourceGenerator.Tests.DynamoDBDocumentTests.Serialize;

[DynamoDBMarshaller(typeof(NullableAnnotationTests))]
Expand Down
8 changes: 7 additions & 1 deletion DynamoDBGenerator.SourceGenerator/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@

namespace DynamoDBGenerator.SourceGenerator;

public class Constants
public static class Constants
{
public const string AssemblyName = nameof(DynamoDBGenerator);
public const string AttributeNameSpace = nameof(Attributes);
public const string MarshallerAttributeName = nameof(DynamoDBMarshallerAttribute);
public const string MarshallerConstructorAttributeName = nameof(DynamoDBMarshallerConstructorAttribute);
public const string DynamoDbDocumentPropertyFullname = $"{AssemblyName}.{AttributeNameSpace}.{MarshallerAttributeName}";

public static class Errors
{


}


public const string NewLine = @"
";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public static string CreateNamespace(this ITypeSymbol type, in string content)
using Amazon.DynamoDBv2.Model;
using DynamoDBGenerator;
using DynamoDBGenerator.Attributes;
using DynamoDBGenerator.Exceptions;
{(nameSpace is null ? null : $@"namespace {nameSpace}
{{")}
Expand Down
9 changes: 0 additions & 9 deletions DynamoDBGenerator/DynamoDBClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,4 @@ public async Task<T> UpdateReturned(TArg entity, Func<IDynamoDBKeyMarshaller, TA

return _marshaller.Unmarshall(result.Attributes);
}
}

public class DynamoDBMarshallingException : InvalidOperationException
{
public string MemberName { get; }
public DynamoDBMarshallingException(string memberName, string message) : base(message: $"{message} (Data member '{memberName}')")
{
MemberName = memberName;
}
}
11 changes: 11 additions & 0 deletions DynamoDBGenerator/Exceptions/DynamoDBMarshallingException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;
namespace DynamoDBGenerator.Exceptions;

public class DynamoDBMarshallingException : InvalidOperationException
{
public string MemberName { get; }
public DynamoDBMarshallingException(string memberName, string message) : base(message: $"{message} (Data member '{memberName}')")
{
MemberName = memberName;
}
}

0 comments on commit 403d78d

Please sign in to comment.