-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retire
ProxyGenerationException
& introduce DynamicProxyException
…
… for internal faults (#528) * Throw `NotImplementedException` in `DefaultValueExpression` when an unexpected type is encountered. Chances are that IL could be emitted for those, so this will be more fitting than `NotSupported- Exception`. * Assert, don't throw in `ConstReference` * Refactor `NewInstanceExpression` to throw early * `InvalidOperationException` for "big sanity check" If it weren't for that comment, an assertion would likely do instead. * Remove pre-VS2010 bug detection code in `AbstractTypeEmitter` * Throw `InvalidOperationException` for uninitialized `ArgumentReference` * Throw `InvalidOperationException` when `IProxyTargetAccessor` is manually implemented * `NotSupportedException` when attribute cannot be replicated * New `DynamicProxyException` for failed assertions / bugs * Update the changelog
- Loading branch information
Showing
16 changed files
with
87 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2004-2020 Castle Project - http://www.castleproject.org/ | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
namespace Castle.DynamicProxy | ||
{ | ||
using System; | ||
using System.Runtime.Serialization; | ||
|
||
// NOTE TO MAINTAINERS: | ||
// Prefer throwing Base Class Library exception types wherever appropriate. | ||
// This exception type is to be used mostly when something inside DynamicProxy goes wrong. | ||
// Think of it as a "failed assertion" / "bug" exception. | ||
[Serializable] | ||
public sealed class DynamicProxyException : Exception | ||
{ | ||
internal DynamicProxyException(string message) : base(message) | ||
{ | ||
} | ||
|
||
internal DynamicProxyException(string message, Exception innerException) : base(message, innerException) | ||
{ | ||
} | ||
|
||
internal DynamicProxyException(SerializationInfo info, StreamingContext context) : base(info, context) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.