-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements DownloadBlock logic DynamicsValue/fake-xrm-easy#157
- Loading branch information
1 parent
69797a8
commit 5c6158b
Showing
4 changed files
with
145 additions
and
3 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/FakeXrmEasy.Core/FileStorage/Db/Exceptions/InvalidBlockLengthException.cs
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,18 @@ | ||
using System; | ||
|
||
namespace FakeXrmEasy.Core.FileStorage.Db.Exceptions | ||
{ | ||
/// <summary> | ||
/// Exception raised when the BlockLength property is not valid | ||
/// </summary> | ||
public class InvalidBlockLengthException: Exception | ||
{ | ||
/// <summary> | ||
/// Default constructor | ||
/// </summary> | ||
public InvalidBlockLengthException() : base($"The BlockLength property must be greater than zero.") | ||
{ | ||
|
||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/FakeXrmEasy.Core/FileStorage/Db/Exceptions/InvalidOffsetException.cs
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,22 @@ | ||
using System; | ||
using FakeXrmEasy.Core.FileStorage.Download; | ||
|
||
namespace FakeXrmEasy.Core.FileStorage.Db.Exceptions | ||
{ | ||
/// <summary> | ||
/// Exception raised when an Offset property is not within the range of a given file length | ||
/// </summary> | ||
public class InvalidOffsetException: Exception | ||
{ | ||
/// <summary> | ||
/// Default constructor | ||
/// </summary> | ||
/// <param name="properties"></param> | ||
/// <param name="actualLength"></param> | ||
internal InvalidOffsetException(DownloadBlockProperties properties, long actualLength) | ||
: base($"The Offset '{properties.Offset.ToString()}' and block lengh '{properties.BlockLength.ToString()}' property values are not within the file's size of [0..{actualLength.ToString()}]") | ||
{ | ||
|
||
} | ||
} | ||
} |
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