completed implementation of exceptions in `SocialVoid.Errors` namespace

-----------------------------------------------------------------------
1. Added `AuthenticationErrors`, `MediaErrors`, `NetworkErrors`, `ServerErrors` and `ValidationErrors` namespaces.
2. Added `Tests.Errors` namespace (using `NUnit.Framework` as test framework),
3. Added github workflows for testing the library,
4. Added `dependabot` and `stale` configurations to the project.
5. Added `CODESTYLE.md` file.

Signed-off-by: Aliwoto <aminnimaj@gmail.com>
This commit is contained in:
Aliwoto 2021-09-01 14:23:50 +00:00
parent 119380ca54
commit 0fb30da3fe
No known key found for this signature in database
GPG Key ID: 646B4FE4205EC48C
53 changed files with 3991 additions and 45 deletions

37
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,37 @@
---
name: Bug fix
about: Create a bug fix to help us improve the library
---
Note: New issues raised, where it is clear the submitter has not read the issue template, are likely to be closed with "please read the issue template". Please don't take offense at this. It is simply a time management decision. If someone raises an issue, and can't be bothered to spend the time to read the issue template, then the project maintainers should not be expected to spend the time to read the submitted issue. Often too much time is spent going back and forth in issue comments asking for information that is outlined in the issue template.
#### Preamble
General questions may be better placed [StackOveflow](https://stackoverflow.com/).
Where relevant, ensure you are using the current stable versions on your development stack. For example:
* Visual Studio
* [.NET SDK or .NET Core SDK](https://www.microsoft.com/net/download)
* Any related NuGet packages
Any code or stack traces must be properly formatted with [GitHub markdown](https://guides.github.com/features/mastering-markdown/).
#### Describe the bug
A clear and concise description of what the bug is. Include any relevant version information.
A clear and concise description of what you expected to happen.
Add any other context about the problem here.
#### Minimal Repro
Ensure you have replicated the bug in a minimal solution with the fewest moving parts. Often this will help point to the true cause of the problem. Upload this repro as part of the issue, preferably a public GitHub repository or a downloadable zip. The repro will allow the maintainers of this project to smoke test the any fix.
#### Submit a PR that fixes the bug
Submit a [Pull Request (PR)](https://help.github.com/articles/about-pull-requests/) that fixes the bug. Include in this PR a test that verifies the fix. If you were not able to fix the bug, a PR that illustrates your partial progress will suffice.

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: StackOverflow
url: https://stackoverflow.com/
about: Please ask and answer questions here.

View File

@ -0,0 +1,33 @@
---
name: Feature request
about: How to raise feature requests
---
Note: New issues raised, where it is clear the submitter has not read the issue template, are likely to be closed with "please read the issue template". Please don't take offense at this. It is simply a time management decision. If someone raises an issue, and can't be bothered to spend the time to read the issue template, then the project maintainers should not be expected to spend the time to read the submitted issue. Often too much time is spent going back and forth in issue comments asking for information that is outlined in the issue template.
If you are certain the feature will be accepted, it is better to raise a [Pull Request (PR)](https://help.github.com/articles/about-pull-requests/).
If you are uncertain if the feature will be accepted, outline the proposal below to confirm it is viable, prior to raising a PR that implements the feature.
Note that even if the feature is a good idea and viable, it may not be accepted since the ongoing effort in maintaining the feature may outweigh the benefit it delivers.
#### Is the feature request related to a problem
A clear and concise description of what the problem is.
#### Describe the solution
A clear and concise proposal of how you intend to implement the feature.
#### Describe alternatives considered
A clear and concise description of any alternative solutions or features you've considered.
#### Additional context
Add any other context about the feature request here.

32
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,32 @@
# This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
# Copyright (c) 2021 SocialVoid.NET Authors.
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this source code of library.
# If not, see <http://www.gnu.org/licenses/>.
version: 2
updates:
- package-ecosystem: nuget
directory: "/SocialVoid"
schedule:
interval: daily
time: "15:00"
timezone: "UTC"
open-pull-requests-limit: 25
labels: ["Dependency"]
milestone: 1
pull-request-branch-name:
separator: "-"
reviewers: ["ALiwoto", "Dank-del"]
target-branch: "master"

37
.github/stale.yml vendored Normal file
View File

@ -0,0 +1,37 @@
# This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
# Copyright (c) 2021 SocialVoid.NET Authors.
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this source code of library.
# If not, see <http://www.gnu.org/licenses/>.
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 14
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 14
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: true
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
pulls:
daysUntilStale: 30
exemptLabels:
- Question
- Bug
- Feature
- Improvement

45
.github/workflows/dotnet-linux.yml vendored Normal file
View File

@ -0,0 +1,45 @@
# This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
# Copyright (c) 2021 SocialVoid.NET Authors.
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this source code of library.
# If not, see <http://www.gnu.org/licenses/>.
name: .NET-linux
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET 3
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Setup .NET 5.1.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore dependencies
run: dotnet restore
- name: Building...
run: dotnet build --no-restore
- name: Testing...
run: dotnet test

45
.github/workflows/dotnet-windows.yml vendored Normal file
View File

@ -0,0 +1,45 @@
# This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
# Copyright (c) 2021 SocialVoid.NET Authors.
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this source code of library.
# If not, see <http://www.gnu.org/licenses/>.
name: .NET-windows
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET 3
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Setup .NET 5.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore dependencies
run: dotnet restore
- name: Building...
run: dotnet build --no-restore
- name: Testing...
run: dotnet test

3
.gitignore vendored
View File

@ -4,3 +4,6 @@ obj/
# ignore experimental directories.
woto_files/
woto_docs/
woto_tests/
woto_objects/

398
CODESTYLE.md Executable file
View File

@ -0,0 +1,398 @@
<!--
This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
Copyright (c) 2021 SocialVoid.NET Authors.
This library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this source code of library.
If not, see <http://www.gnu.org/licenses/>.
-->
> #### NOTE: This code style standard for SocialVoid.NET is a work in progress and much of the code does not currently conform to these rules. This is something that will be addressed by the core team.
# Introduction
As the SocialVoid.NET project gains more traction and becomes more widely used, we aim to provide a more professional and consistent look to the large amount of source now in the project. It was a broadly supported decision by the core development team to follow the Microsoft coding guidelines (the default provided in Visual Studio's C# editor). These coding guidelines listed below are based on a [MSDN blog post](http://blogs.msdn.com/b/brada/archive/2005/01/26/361363.aspx) from 2005 by Brad Abrams describing the internal coding guidelines at Microsoft, with some changes to suit our project.
# Coding Guidelines
## Tabs & Indenting
Tab characters (`\0x09`) **should** be used in code. All indentation should be done with Tab Size of 4.
<hr/>
## Bracing
Open braces should always be at the beginning of the line after the statement that begins the block. Contents of the brace should be indented by 4 spaces. Single statements **should** have braces. For example:
```csharp
if (someExpression)
{
DoSomething();
DoAnotherThing();
}
else
{
DoSomethingElse();
}
```
`case` statements should be indented from the switch statement like this:
```csharp
switch (someExpression)
{
case 0:
DoSomething();
break;
case 1:
DoSomethingElse();
break;
case 2:
{
int n = 1;
DoAnotherThing(n);
}
break;
case 3:
{
DoSomething();
break;
}
}
```
Braces also **should** be used for single statement blocks immediately following a `for`, `foreach`, `if`, `do`, etc. The single statement block should always be on the following line and indented by Tab. This increases code readability and maintainability.
```csharp
for (int i = 0; i < 100; ++i)
{
DoSomething(i);
}
```
<hr/>
## Single line property statements
Single line property statements can have braces that begin and end on the same line. This should only be used for simple property statements. Add a single space before and after the braces.
```csharp
public class Foo
{
int bar1;
public int Bar1
{
get { return bar1; }
set { bar1 = value; }
}
public int Bar2 { get; set; }
}
```
<hr/>
## Commenting
Comments **should** be used to describe intention, algorithmic overview, and/or logical flow. It would be ideal if, from reading the comments alone, someone other than the author could understand a function's intended behavior and general operation.
While there are no minimum comment requirements (and certainly some very small routines need no commenting at all), it is best that most routines have comments reflecting the programmer's intent and approach.
Comments must provide added value or explanation to the code. Simply describing the code is not helpful or useful.
```csharp
// Wrong
// Set count to 1
count = 1;
// Right
// Set the initial reference count so it isn't cleaned up next frame
count = 1;
```
<hr/>
### Copyright/License notice
Each file **should** start with a copyright notice. This is a short statement declaring the project name and copyright notice, and directing the reader to the license document elsewhere in the project. To avoid errors in doc comment builds, avoid using triple-slash doc comments.
```csharp
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
```
<hr/>
### Documentation Comments
All methods should use XML doc comments. For internal dev comments, the `<!-- -->` tag should be used (you can also use <devdoc>).
> after your pull request is accepted by the moderators, we will add `<code> Since: v0.0.0 </code>` to the XML comments so the users won't be confused about version conflicts.
```csharp
/// <summary>
/// The Foo class has usage of ....
/// <code> Since: v0.0.0 </code>
/// <summary>
public class Foo
{
/// <summary>
/// Public stuff about the method
/// <code> Since: v0.0.0 </code>
/// </summary>
/// <param name="bar">
/// What a neat parameter!
/// </param>
/// <devdoc>
/// Cool internal stuff!
/// </devdoc>
public void MyMethod(int bar)
{
...
}
}
```
<hr/>
### Comment Style
The `//` (two slashes) style of comment tags should be used in most situations. Wherever possible, place comments above the code instead of beside it. Here are some examples:
```csharp
// This is required for WebClient to work through the proxy
GlobalProxySelection.Select = new WebProxy("http://itgproxy");
// Create object to access Internet resources
WebClient myClient = new WebClient();
```
<hr/>
## Spacing
Spaces improve readability by decreasing code density. Here are some guidelines for the use of space characters within code:
**Do** use a single space after a comma between function arguments.
```csharp
Console.In.Read(myChar, 0, 1); // Right
Console.In.Read(myChar,0,1); // Wrong
```
**Do not** use a space after the parenthesis and function arguments.
```csharp
CreateFoo(myChar, 0, 1); // Right
CreateFoo( myChar, 0, 1 ); // Wrong
```
**Do not** use spaces between a function name and parentheses.
```csharp
CreateFoo() // Right
CreateFoo () // Wrong
```
**Do not** use spaces inside brackets.
```csharp
x = dataArray[index]; // Right
x = dataArray[ index ]; // Wrong
```
**Do** use a single space before flow control statements.
```csharp
while (x == y) // Right
while(x==y) // Wrong
```
**Do** use a single space before and after binary operators.
```csharp
if (x == y) // Right
if (x==y) // Wrong
```
**Do not** use a space between a unary operator and the operand.
```csharp
++i; // Right
++ i; // Wrong
```
**Do not** use a space before a semi-colon.
**Do** use a space after a semi-colon if there is more on the same line.
```csharp
for (int i = 0; i < 100; ++i) // Right
for (int i=0 ; i<100 ; ++i) // Wrong
```
<hr/>
## Naming
Follow all .NET Framework Design Guidelines for both internal and external members. Highlights of these include:
* **Do not** use Hungarian notation
* **Do** use an underscore prefix for member variables, e.g. "_foo"
* **Do** use camelCasing for member variables (first word all lowercase, subsequent words initial uppercase)
* **Do** use camelCasing for parameters
* **Do** use camelCasing for local variables
* **Do** use PascalCasing for function, property, event, and class names (all words initial uppercase)
* **Do** prefix interfaces names with "I"
* **Do not** prefix enums, classes, or delegates with any letter
The reasons to extend the public rules (no Hungarian, underscore prefix for member variables, etc.) is to produce a consistent source code appearance.
In addition, the goal is to have clean, readable source. Code legibility should be a primary goal.
<hr/>
## File Organization
* Source files should contain only one public type, although multiple internal types are permitted if required.
* Source files should be given the name of the public type in the file.
* Directory names should follow the namespace for the class after `SocialVoid`. For example, one would expect to find the public class `SocialVoid.Constants.WotoTools` in **SocialVoid\Constants\WotoTools.cs**.
* Class members should be grouped logically, and encapsulated into regions:
```csharp
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
// some members here
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
// some members here
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
```
and as for methods (you have to place the methods after normal members):
```csharp
//-------------------------------------------------
#region Initialize Method's Region
// some methods here
#endregion
//-------------------------------------------------
#region Graphical Method's Region
// some methods here
#endregion
//-------------------------------------------------
#region event Method's Region
// some methods here
#endregion
//-------------------------------------------------
#region overrided Method's Region
// some methods here
#endregion
//-------------------------------------------------
#region ordinary Method's Region
// some methods here
#endregion
//-------------------------------------------------
#region Get Method's Region
// some methods here
#endregion
//-------------------------------------------------
#region Set Method's Region
// some methods here
#endregion
//-------------------------------------------------
#region static Method's Region
// some methods here
#endregion
//-------------------------------------------------
```
* lines should be used between regions, until the 60th character of that line.
* Using statements **should** be before the namespace declaration.
```csharp
using System;
namespace MyNamespace
{
public class MyClass : IFoo
{
//-------------------------------------------------
#region Constant's Region
public const int constInt = 10;
#endregion
//-------------------------------------------------
#region static Properties Region
/// <summary>
/// The Big Father of the <see cref="GraphicElement"/>!
/// </summary>
public static SomeClass AnotherClass
{
get => ThereIsConstants.AllClasses.AnotherClass;
}
#endregion
//-------------------------------------------------
#region Properties Region
public virtual WotoRes MyRes { get; set; }
#endregion
//-------------------------------------------------
#region Constructor Region
public MyClass()
{
...
}
#endregion
//-------------------------------------------------
#region Destructor's Region
~MyClass()
{
...
}
#endregion
//-------------------------------------------------
#region ordinary Methods
void DoSomething()
{
...
}
void FindSomething()
{
...
}
#endregion
//-------------------------------------------------
}
}
```
# Useful Links
[C# Coding Conventions (MSDN)](http://msdn.microsoft.com/en-us/library/ff926074.aspx)

1
README.md Normal file
View File

@ -0,0 +1 @@
# SocialVoid.NET

View File

@ -0,0 +1,85 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.NetworkErrors
{
/// <summary>
/// This exception will be raised when the client is attempting
/// to authenticate when already authenticated.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class AlreadyAuthenticatedException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.AlreadyAuthenticated"/> error code
/// will be returned because the client is attempting to
/// authenticate while it's already authenticated.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.AlreadyAuthenticated;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="AlreadyAuthenticatedException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal AlreadyAuthenticatedException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,88 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.NetworkErrors
{
/// <summary>
/// This exception will be raised when the authentication process failed
/// for some unexpected reason; you need to see the exception message
/// for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class AuthenticationFailureException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.AuthenticationFailure"/> error code
/// will be returned because the authentication process failed
/// for some unexpected reason;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.AuthenticationFailure;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of
/// <see cref="AuthenticationFailureException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal AuthenticationFailureException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,87 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.NetworkErrors
{
/// <summary>
/// This exception will be raised when the user does not support
/// this method of authentication;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class AuthenticationNotApplicableException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.AuthenticationNotApplicable"/> error code
/// will be returned because the user does not support this method
/// of authentication; please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.AuthenticationNotApplicable;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of
/// <see cref="AuthenticationNotApplicableException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal AuthenticationNotApplicableException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,85 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.NetworkErrors
{
/// <summary>
/// This exception will be raised when the given session challenge answer
/// is incorrect or out of sync.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class BadSessionChallengeAnswerException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.BadSessionChallengeAnswer"/> error code
/// will be returned because the given session challenge answer
/// is incorrect or out of sync.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.BadSessionChallengeAnswer;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="BadSessionChallengeAnswerException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal BadSessionChallengeAnswerException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,84 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.NetworkErrors
{
/// <summary>
/// This exception will be raised when the given login credentials
/// are incorrect.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class IncorrectLoginCredentialsException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.IncorrectLoginCredentials"/> error code
/// will be returned because the given login credentials are incorrect.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.IncorrectLoginCredentials;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="IncorrectLoginCredentialsException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal IncorrectLoginCredentialsException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,86 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.NetworkErrors
{
/// <summary>
/// This exception will be raised when the given two-factor
/// authentication code is incorrect.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class IncorrectTwoFactorAuthenticationCodeException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.IncorrectTwoFactorAuthenticationCode"/> error code
/// will be returned because the given two-factor authentication code
/// is incorrect.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.IncorrectTwoFactorAuthenticationCode;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of
/// <see cref="IncorrectTwoFactorAuthenticationCodeException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal IncorrectTwoFactorAuthenticationCodeException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,85 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.NetworkErrors
{
/// <summary>
/// This exception will be raised when the client attempts to
/// invoke a method that requires authentication.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class NotAuthenticatedException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.NotAuthenticated"/> error code
/// will be returned because the client attempts
/// to invoke a method that requires authentication.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.NotAuthenticated;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="NotAuthenticatedException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal NotAuthenticatedException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,88 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.NetworkErrors
{
/// <summary>
/// This exception will be raised when the user/entity uses a
/// Private Access Token to authenticate and the client attempted
/// to authenticate in another way.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class PrivateAccessTokenRequiredException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.PrivateAccessTokenRequired"/> error code
/// will be returned because the user/entity uses a
/// Private Access Token to authenticate and the client attempted
/// to authenticate in another way.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.PrivateAccessTokenRequired;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of
/// <see cref="PrivateAccessTokenRequiredException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal PrivateAccessTokenRequiredException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,19 @@
# Authentication Errors
These errors are raised when anything related to authentication has failed,
this can include things from when trying to authenticate to session
challenge errors.
| Name | Code | Hex Code | Deprecated | Versions | Description |
|--------------------------------------|------|----------|------------|----------|--------------------------------------------------------------------------------------------------------------------------------------|
| IncorrectLoginCredentials | 8704 | 0x02200 | No | 1.0 | The given login credentials are incorrect |
| IncorrectTwoFactorAuthenticationCode | 8705 | 0x02201 | No | 1.0 | The given two-factor authentication code is incorrect |
| AuthenticationNotApplicable | 8706 | 0x02202 | No | 1.0 | Raised when the user does not support this method of authentication, see the message for further details |
| SessionNotFound | 8707 | 0x02203 | No | 1.0 | Raised when the requested session was not found in the network |
| NotAuthenticated | 8708 | 0x02204 | No | 1.0 | Raised when the client attempts to invoke a method that requires authentication |
| PrivateAccessTokenRequired | 8709 | 0x02205 | No | 1.0 | Raised when the user/entity uses a Private Access Token to authenticate and the client attempted to authenticate in another way. |
| AuthenticationFailure | 8710 | 0x02206 | No | 1.0 | The authentication process failed for some unexpected reason, see the message for further details. |
| BadSessionChallengeAnswer | 8711 | 0x02207 | No | 1.0 | The given session challenge answer is incorrect or out of sync. |
| TwoFactorAuthenticationRequired | 8712 | 0x02208 | No | 1.0 | Two-Factor Authentication is required, the client must repeat the same request but provide a Two-Factor authentication code as well. |
| AlreadyAuthenticated | 8713 | 0x02209 | No | 1.0 | The client is attempting to authenticate when already authenticated |
| SessionExpired | 8714 | 0x0220a | No | 1.0 | Raised when trying to use a session that has expired |

View File

@ -0,0 +1,85 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.NetworkErrors
{
/// <summary>
/// This exception will be raised when the client tried to use a session
/// that has been expired.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class SessionExpiredException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.SessionExpired"/> error code
/// will be returned because the client tried to use a session
/// that has been expired.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.SessionExpired;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="SessionExpiredException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal SessionExpiredException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,85 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.NetworkErrors
{
/// <summary>
/// This exception will be raised when the requested session can
/// not be found in the database on server-side.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class SessionNotFoundException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InvalidUsername"/> error code
/// will be returned because the requested session was
/// not found in the database on server-side.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.SessionNotFound;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="SessionNotFoundException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal SessionNotFoundException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,87 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.NetworkErrors
{
/// <summary>
/// This exception will be raised when the Two-Factor Authentication
/// is required and so the client must repeat the same request
/// but provide a Two-Factor authentication code as well.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class TwoFactorAuthenticationRequiredException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.TwoFactorAuthenticationRequired"/>
/// error code will be returned because the Two-Factor Authentication
/// is required and so the client must repeat the same request
/// but provide a Two-Factor authentication code as well.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.TwoFactorAuthenticationRequired;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="TwoFactorAuthenticationRequiredException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal TwoFactorAuthenticationRequiredException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -1,7 +1,273 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors
{
/// <summary>
/// All error codes received from the SocialVoid servers.
/// <code> Since: v0.0.0 </code>
/// </summary>
public enum ErrorCodes
{
//-------------------------------------------------
#region Unknown Error
/// <summary>
/// This error code will be returned when the error is not
/// implimented on client-side at all.
/// <code> Since: v0.0.0 </code>
/// </summary>
UnknownError = 0,
#endregion
//-------------------------------------------------
#region Validation Errors
/// <summary>
/// This error code will be returned when the given username
/// is invalid and does not meet the specification.
/// <code> Since: v0.0.0 </code>
/// <!--
/// These are errors raised when the client passes
/// on parameters or data that is invalid in some way or another.
/// -->
/// </summary>
InvalidUsername = 8448,
/// <summary>
/// This error code will be returned when the given password is
/// invalid and/or insecure and does not meet the specification.
/// <code> Since: v0.0.0 </code>
/// </summary>
InvalidPassword = 8449,
/// <summary>
/// This error code will be returned when the First Name provided
/// contains invalid characters and or is too long;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
InvalidFirstName = 8450,
/// <summary>
/// This error code will be returned when the Last Name provided
/// contains invalid characters and or is too long;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
InvalidLastName = 8451,
/// <summary>
/// This error code will be returned when the Biography is too long or
/// contains invalid characters;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
InvalidBiography = 8452,
/// <summary>
/// This error code will be returned when the given username
/// is already registered in the server and cannot be used.
/// <code> Since: v0.0.0 </code>
/// </summary>
UsernameAlreadyExists = 8453,
/// <summary>
/// This error code will be returned when the client provided
/// an invalid peer identification as input.
/// <code> Since: v0.0.0 </code>
/// </summary>
InvalidPeerInput = 8454,
/// <summary>
/// This error code will be returned when the post contains
/// invalid characters or is too long;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
InvalidPostText = 8455,
/// <summary>
/// This error code will be returned when the client's public hash
/// is invalid and cannot be identified as a sha256.
/// <code> Since: v0.0.0 </code>
/// </summary>
InvalidClientPublicHash = 8456,
/// <summary>
/// This error code will be returned when the client's private hash
/// is invalid and cannot be identified as a sha256.
/// <code> Since: v0.0.0 </code>
/// </summary>
InvalidClientPrivateHash = 8457,
/// <summary>
/// This error code will be returned when the version is invalid
/// or is too long;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
InvalidVersion = 8459,
/// <summary>
/// This error code will be returned when the client name contains
/// invalid characters or is too long;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
InvalidClientName = 8460,
/// <summary>
/// This error code will be returned when the session identification
/// object is invalid;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
InvalidSessionIdentification = 8461,
/// <summary>
/// This error code will be returned when the platform name contains
/// invalid characters or is too long;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
InvalidPlatform = 8464,
#endregion
//-------------------------------------------------
#region Authentication Errors
/// <summary>
/// This error code will be returned when the given login credentials
/// are incorrect.
/// <code> Since: v0.0.0 </code>
/// <!--
/// These errors are raised when anything related to authentication
/// has failed, this can include things from when trying
/// to authenticate to session challenge errors.
/// -->
/// </summary>
IncorrectLoginCredentials = 8704,
/// <summary>
/// This error code will be returned when the given two-factor
/// authentication code is incorrect.
/// <code> Since: v0.0.0 </code>
/// </summary>
IncorrectTwoFactorAuthenticationCode = 8705,
/// <summary>
/// This error code will be returned when the user does not support
/// this method of authentication;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
AuthenticationNotApplicable = 8706,
/// <summary>
/// This error code will be returned when the requested session
/// was not found in the database on server-side.
/// <code> Since: v0.0.0 </code>
/// </summary>
SessionNotFound = 8707,
/// <summary>
/// This error code will be returned when the client attempts
/// to invoke a method that requires authentication.
/// <code> Since: v0.0.0 </code>
/// </summary>
NotAuthenticated = 8708,
/// <summary>
/// This error code will be returned when the user/entity uses
/// a Private Access Token to authenticate and the client
/// attempted to authenticate in another way.
/// <code> Since: v0.0.0 </code>
/// </summary>
PrivateAccessTokenRequired = 8709,
/// <summary>
/// This error code will be returned when the authentication process
/// failed for some unexpected reason;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
AuthenticationFailure = 8710,
/// <summary>
/// This error code will be returned when the given session
/// challenge answer is incorrect or out of sync.
/// <code> Since: v0.0.0 </code>
/// </summary>
BadSessionChallengeAnswer = 8711,
/// <summary>
/// This error code will be returned when the Two-Factor
/// Authentication is required and so the client must repeat
/// the same request but provide a Two-Factor authentication
/// code as well.
/// <code> Since: v0.0.0 </code>
/// </summary>
TwoFactorAuthenticationRequired = 8712,
/// <summary>
/// This error code will be returned when the client is attempting
/// to authenticate when already authenticated.
/// <code> Since: v0.0.0 </code>
/// </summary>
AlreadyAuthenticated = 8713,
/// <summary>
/// This error code will be returned when trying to use a
/// session that has been expired.
/// <code> Since: v0.0.0 </code>
/// </summary>
SessionExpired = 8714,
#endregion
//-------------------------------------------------
#region Media Errors
// TODO: This part is a work in progress,
// media has yet to be implemented on the server-side.
#endregion
//-------------------------------------------------
#region Network Errors
/// <summary>
/// This error code will be returned when the requested user entity
/// was not found on the server-side.
/// <code> Since: v0.0.0 </code>
/// <!--
/// These are the catch-all errors when dealing with the network, from
/// finding peers, following them, posting, etc...
/// -->
/// </summary>
PeerNotFound = 12544,
/// <summary>
/// This error code will be returned when the client requested
/// a post that isn't found (or does not exist on the server-side).
/// <code> Since: v0.0.0 </code>
/// </summary>
PostNotFound = 12545,
/// <summary>
/// This error code will be returned when the client requested a post
/// that was deleted.
/// <code> Since: v0.0.0 </code>
/// </summary>
PostDeleted = 12546,
/// <summary>
/// This error code will be returned when the client attempts to
/// repost a post that has already been reposted (by the same user).
/// <code> Since: v0.0.0 </code>
/// </summary>
AlreadyReposted = 12547,
/// <summary>
/// This error code will be returned when there was an error while
/// trying to upload one or more files to the server.
/// <code> Since: v0.0.0 </code>
/// </summary>
FileUploadError = 12548,
#endregion
//-------------------------------------------------
#region Server Errors
/// <summary>
/// This error code will be returned when there was an unexpected
/// error while trying to process your request.
/// <code> Since: v0.0.0 </code>
/// <!--
/// These error codes are usually returned as a last resort
/// when something is wrong with the server.
/// -->
/// </summary>
InternalServerError = 16384,
#endregion
//-------------------------------------------------
}
}
}

View File

@ -1,12 +1,203 @@
using System;
using SocialVoid.Errors.ServerErrors;
using SocialVoid.Errors.NetworkErrors;
using SocialVoid.Errors.ValidationErrors;
namespace SocialVoid.Errors {
namespace SocialVoid.Errors
{
/// <summary>
///
/// <code> Since: v0.0.0 </code>
/// </summary>
public class GeneralException : Exception
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The error code of this exception which is received from
/// the server.
/// <devdoc>
/// This property needs to be overrided in specific exception
/// classes of this library.
/// </devdoc>
/// <code> Since: v0.0.0 </code>
/// </summary>
public virtual ErrorCodes ErrorCode { get; }
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="GeneralException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
/// <param name="message">
/// the error message received from the server.
/// </param>
public GeneralException(string message) : base(message)
internal GeneralException(string message) : base(message)
{
}
/// <summary>
/// Creates a new instance of <see cref="GeneralException"/> using
/// the specified error message and erro code.
/// <code> Since: v0.0.0 </code>
/// </summary>
/// <param name="message">
/// the error message received from the server.
/// </param>
/// <param name="code">
/// the error code received from the server.
/// </param>
private GeneralException(string message, ErrorCodes code) : base(message)
{
ErrorCode = code;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
#region Initialize Method's Region
// some methods here
#endregion
//-------------------------------------------------
#region Graphical Method's Region
// some methods here
#endregion
//-------------------------------------------------
#region event Method's Region
// some methods here
#endregion
//-------------------------------------------------
#region overrided Method's Region
// some methods here
#endregion
//-------------------------------------------------
#region ordinary Method's Region
// some methods here
#endregion
//-------------------------------------------------
#region Get Method's Region
// some methods here
#endregion
//-------------------------------------------------
#region Set Method's Region
// some methods here
#endregion
//-------------------------------------------------
#region static Method's Region
/// <summary>
/// GetException will return a new exception based on the
/// error code received from the server with the specified
/// error message.
/// <code> Since: v0.0.0 </code>
/// </summary>
public static GeneralException GetException(string m, ErrorCodes err)
{
return err switch
{
// Unknown Error
ErrorCodes.UnknownError => new(m),
// Validation Errors
ErrorCodes.InvalidUsername =>
new InvalidUsernameException(m),
ErrorCodes.InvalidPassword =>
new InvalidPasswordException(m),
ErrorCodes.InvalidFirstName =>
new InvalidFirstNameException(m),
ErrorCodes.InvalidLastName =>
new InvalidLastNameException(m),
ErrorCodes.InvalidBiography =>
new InvalidBiographyException(m),
ErrorCodes.UsernameAlreadyExists =>
new UsernameAlreadyExistsException(m),
ErrorCodes.InvalidPeerInput =>
new InvalidPeerInputException(m),
ErrorCodes.InvalidPostText =>
new InvalidPostTextException(m),
ErrorCodes.InvalidClientPublicHash =>
new InvalidClientPublicHashException(m),
ErrorCodes.InvalidClientPrivateHash =>
new InvalidClientPrivateHashException(m),
ErrorCodes.InvalidVersion =>
new InvalidVersionException(m),
ErrorCodes.InvalidClientName =>
new InvalidClientNameException(m),
ErrorCodes.InvalidSessionIdentification =>
new InvalidSessionIdentificationException(m),
ErrorCodes.InvalidPlatform =>
new InvalidPlatformException(m),
// Authentication Errors
ErrorCodes.IncorrectLoginCredentials =>
new IncorrectLoginCredentialsException(m),
ErrorCodes.IncorrectTwoFactorAuthenticationCode =>
new IncorrectTwoFactorAuthenticationCodeException(m),
ErrorCodes.AuthenticationNotApplicable =>
new AuthenticationNotApplicableException(m),
ErrorCodes.SessionNotFound =>
new SessionNotFoundException(m),
ErrorCodes.NotAuthenticated =>
new NotAuthenticatedException(m),
ErrorCodes.PrivateAccessTokenRequired =>
new PrivateAccessTokenRequiredException(m),
ErrorCodes.AuthenticationFailure =>
new AuthenticationFailureException(m),
ErrorCodes.BadSessionChallengeAnswer =>
new BadSessionChallengeAnswerException(m),
ErrorCodes.TwoFactorAuthenticationRequired =>
new TwoFactorAuthenticationRequiredException(m),
ErrorCodes.AlreadyAuthenticated =>
new AlreadyAuthenticatedException(m),
ErrorCodes.SessionExpired =>
new SessionExpiredException(m),
// Media Errors
// Network Errors
ErrorCodes.PeerNotFound =>
new PeerNotFoundException(m),
ErrorCodes.PostNotFound =>
new PostNotFoundException(m),
ErrorCodes.PostDeleted =>
new PostDeletedException(m),
ErrorCodes.AlreadyReposted =>
new AlreadyRepostedException(m),
ErrorCodes.FileUploadError =>
new FileUploadErrorException(m),
// Server Errors
ErrorCodes.InternalServerError =>
new InternalServerErrorException(m),
// an unknown error code?
_ => new(m, err)
};
}
#endregion
//-------------------------------------------------
}
}
}

View File

@ -0,0 +1,3 @@
# MediaErrors
This part is a work in progress, media has yet to be implemented.

View File

@ -0,0 +1,85 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.NetworkErrors
{
/// <summary>
/// This exception will be raised when the client attempts to repost a
/// post that has already been reposted (by the same user).
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class AlreadyRepostedException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.AlreadyReposted"/> error code
/// will be returned because the client attempted to repost a
/// post that has already been reposted (by the same user).
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.AlreadyReposted;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="AlreadyRepostedException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal AlreadyRepostedException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,85 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.NetworkErrors
{
/// <summary>
/// This exception will be raised when there was an error while trying to
/// upload one or more files to the server.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class FileUploadErrorException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.FileUploadError"/> error code
/// will be returned because there was an error while trying to
/// upload one or more files to the server.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.FileUploadError;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="FileUploadErrorException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal FileUploadErrorException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,85 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.NetworkErrors
{
/// <summary>
/// This exception will be raised when the requested user entity
/// can not be not found on the server-side.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class PeerNotFoundException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.PeerNotFound"/> error code
/// will be returned because the requested user entity was not found
/// on the server-side.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.PeerNotFound;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="AlreadyRepostedException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal PeerNotFoundException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,85 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.NetworkErrors
{
/// <summary>
/// This exception will be raised when the client requests a post that
/// is deleted.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class PostDeletedException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.PostDeleted"/> error code
/// will be returned because the client requested a post that
/// was deleted.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.PostDeleted;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="PostDeletedException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal PostDeletedException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,85 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.NetworkErrors
{
/// <summary>
/// This exception will be raised when the client requests a post that
/// isn't found (or does not exist on the server-side).
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class PostNotFoundException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InvalidUsername"/> error code
/// will be returned because the client requested a post that
/// isn't found (or does not exist on the server-side).
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.PostNotFound;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="PostNotFoundException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal PostNotFoundException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,12 @@
# NetworkErrors
These are the catch-all errors when dealing with the network, from
finding peers, following them, posting, etc.
| Name | Code | Hex Code | Deprecated | Versions | Description |
|-----------------|-------|----------|------------|----------|----------------------------------------------------------------------------------------|
| PeerNotFound | 12544 | 0x03100 | No | 1.0 | The requested user entity was not found in the network |
| PostNotFound | 12545 | 0x03101 | No | 1.0 | Raised when the client requested a post that isn't found |
| PostDeleted | 12546 | 0x03102 | No | 1.0 | Raised when the client requested a post that was deleted |
| AlreadyReposted | 12547 | 0x03103 | No | 1.0 | Raised when the client attempts to repost a post that has already been reposted |
| FileUploadError | 12548 | 0x03104 | No | 1.0 | Raised when there was an error while trying to upload one or more files to the network |

View File

@ -0,0 +1,61 @@
# Errors
Socialvoid has it's own unique set of error codes aside from the ones
used by the standard of the RCP server. while your client should handle
standard error codes of the RCP protcol; if you are building a Socialvoid
client then it's important that your client can handle and represent these
errors returned by the Socialvoid Server.
These errors are designed to explain what the issue is to the client or
user, in cases the client use these errors to automatically correct their
request but some errors may be caused by users as well. so it's important
that your client can understand and catch these errors accordingly.
## Error Codes
Errors come in three components.
- Name
- Code
- Message
### Name
The name is the name of the error, it can be anything from `PeerNotFound`
to `InternalServerError`, this makes it easier for programming languages
to use a try catch statement to catch specific errors.
### Code
The error code is an alternative way to identify the error when the
name is not available or trying to catch a wide range of specific errors.
These are usually represented in integers.
### Message
A message explains more details about the error, while the same error
can occur for Situation A and B; Situation B may have a different reason
for the same error. This should not be used as a way to identify the error
and usually serves the purpose of troubleshooting or displaying the error
to the user.
--------------------------------------------------------------------------
## Error Types
Errors are split into sections to make it more easier to manage, you can
either identify errors indivdually by their error code or by range.
| Section | Set | Range | Description |
|-----------------------|-----|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Validation Errors | 21 | 8448 - 8703 | Errors that returns when the given parameters or data is invalid in some way or another |
| Authentication Errors | 22 | 8704 - 8979 | Errors related to authentication/session management, these errors are usually returned when there was an error while trying to authenticate or there are session errors such as the session being expired. |
| Media Errors | 23 | 8960 - 12543 | Errors related to the media on the network, errors are usually returned if your client uploads bad media files or for some reason there is an error related to the media content on the network. |
| Network Errors | 31 | 12544 - 16383 | Errors related to actions on the network, peers not being found, posts not being found, incorrect permissions, rate limits, etc. |
| Server Errors | 40 | 16384 - *(?) | Errors related to the server, unexpected errors, servers related to administrators/moderators performing administrative tasks on the server |
## Error Codes
- [Validation Errors](ValidationErrors.md) 8448 - 8703
- [Authentication Errors](AuthenticationErrors.md) 8704 - 8979
- [Media Errors](MediaErrors.md) 8960 - 12543
- [Network Errors](NetworkErrors.md) 12544 - 16383
- [Server Errors](ServerErrors.md) 16384 - *(?)

View File

@ -0,0 +1,85 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.ServerErrors
{
/// <summary>
/// This exception will be raised when there is an unexpected error
/// while server tried to process our request.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class InternalServerErrorException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InternalServerError"/> error code
/// will be returned because there was an unexpected error
/// while trying to process your request.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.InternalServerError;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="InternalServerErrorException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal InternalServerErrorException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,8 @@
# ServerErrors
These errors are usually rasied as a last resort when something is wrong
with the server.
| Name | Code | Hex Code | Deprecated | Versions | Description |
|---------------------|-------|----------|------------|----------|---------------------------------------------------------------------------------|
| InternalServerError | 16384 | 0x04000 | No | 1.0 | Raised when there was an unexpected error while trying to process your request. |

View File

@ -0,0 +1,87 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.ValidationErrors
{
/// <summary>
/// This exception will be raised when the Biography is too long
/// or contains invalid characters;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class InvalidBiographyException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InvalidBiography"/> error code
/// will be returned because the Biography is too long
/// or contains invalid characters;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.InvalidBiography;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="InvalidBiographyException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal InvalidBiographyException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,87 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.ValidationErrors
{
/// <summary>
/// This exception will be raised when the client name contains invalid
/// characters or is too long;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class InvalidClientNameException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InvalidClientName"/> error code
/// will be returned because the client name contains invalid
/// characters or is too long;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.InvalidClientName;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="InvalidClientNameException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal InvalidClientNameException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,86 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.ValidationErrors
{
/// <summary>
/// This exception will be raised when the client's private hash is invalid
/// and cannot be identified as a sha256.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class InvalidClientPrivateHashException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InvalidClientPrivateHash"/> error code
/// will be returned because the client's private hash is invalid
/// and cannot be identified as a sha256.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.InvalidClientPrivateHash;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of
/// <see cref="InvalidClientPrivateHashException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal InvalidClientPrivateHashException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,85 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.ValidationErrors
{
/// <summary>
/// This exception will be raised when the client's public hash is invalid
/// and cannot be identified as a sha256.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class InvalidClientPublicHashException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InvalidClientPublicHash"/> error code
/// will be returned because the client's public hash is invalid
/// and cannot be identified as a sha256.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.InvalidClientPublicHash;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="InvalidClientPublicHashException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal InvalidClientPublicHashException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,87 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.ValidationErrors
{
/// <summary>
/// This exception will be raised when the First Name provided contains
/// invalid characters and or is too long;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class InvalidFirstNameException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InvalidFirstName"/> error code
/// will be returned because the First Name provided contains
/// invalid characters and or is too long;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.InvalidFirstName;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="InvalidFirstNameException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal InvalidFirstNameException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,87 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.ValidationErrors
{
/// <summary>
/// This exception will be raised when the Last Name provided contains
/// invalid characters and or is too long;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class InvalidLastNameException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InvalidLastName"/> error code
/// will be returned because the Last Name provided contains
/// invalid characters and or is too long;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.InvalidLastName;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="InvalidLastNameException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal InvalidLastNameException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,85 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.ValidationErrors
{
/// <summary>
/// This exception will be raised when the given password is invalid and/or
/// insecure and does not meet the specification.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class InvalidPasswordException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InvalidPassword"/> error code
/// will be returned because the given password is invalid and/or
/// insecure and does not meet the specification.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.InvalidPassword;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="InvalidPasswordException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal InvalidPasswordException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,85 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.ValidationErrors
{
/// <summary>
/// This exception will be raised when the client provide an invalid
/// peer identification as input.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class InvalidPeerInputException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InvalidPeerInput"/> error code
/// will be returned because the client provided an invalid
/// peer identification as input.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.InvalidPeerInput;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="InvalidPeerInputException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal InvalidPeerInputException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,87 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.ValidationErrors
{
/// <summary>
/// This exception will be raised when the platform name contains invalid
/// characters or is too long;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class InvalidPlatformException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InvalidPlatform"/> error code
/// will be returned because the platform name contains invalid
/// characters or is too long;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.InvalidPlatform;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="InvalidPlatformException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal InvalidPlatformException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,87 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.ValidationErrors
{
/// <summary>
/// This exception will be raised when the post contains invalid
/// characters or is too long;
/// please see the exception message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class InvalidPostTextException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InvalidPostText"/> error code
/// will be returned because the post contains invalid characters
/// or is too long;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.InvalidPostText;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="InvalidPostTextException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal InvalidPostTextException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,88 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.ValidationErrors
{
/// <summary>
/// This exception will be raised when the session identification
/// object is invalid;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class InvalidSessionIdentificationException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InvalidSessionIdentification"/>
/// error code will be returned because the session identification
/// object is invalid;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.InvalidSessionIdentification;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of
/// <see cref="InvalidSessionIdentificationException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal InvalidSessionIdentificationException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,85 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.ValidationErrors
{
/// <summary>
/// This exception will be raised when the given username is invalid
/// and does not meet the specification.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class InvalidUsernameException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InvalidUsername"/> error code
/// will be returned because the given username is invalid and
/// does not meet the specifications.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.InvalidUsername;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="InvalidUsernameException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal InvalidUsernameException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,85 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.ValidationErrors
{
/// <summary>
/// This exception will be raised when the given username is invalid
/// and does not meet the specification.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class InvalidVersionException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InvalidVersion"/> error code
/// will be returned because the version is invalid or is too long;
/// please see the message for further details.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.InvalidVersion;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="InvalidVersionException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal InvalidVersionException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -0,0 +1,21 @@
# Validation Errors
These are errors raised when your client passes on parameters or data
that is invalid in some way or another.
| Name | Code | Hex Code | Deprecated | Versions | Description |
|------------------------------|------|----------|------------|----------|-------------------------------------------------------------------------------------------------------------|
| InvalidUsername | 8448 | 0x02100 | No | 1.0 | The given username is invalid and does not meet the specification |
| InvalidPassword | 8449 | 0x02101 | No | 1.0 | The given password is invalid and/or insecure and does not meet the specification |
| InvalidFirstName | 8450 | 0x02102 | No | 1.0 | The First Name provided contains invalid characters and or is too long, see the message for further details |
| InvalidLastName | 8451 | 0x02103 | No | 1.0 | The Last Name provided contains invalid characters and or is too long, see the message for further details |
| InvalidBiography | 8452 | 0x02104 | No | 1.0 | The Biography is too long or contains invalid characters, see the message for further details |
| UsernameAlreadyExists | 8453 | 0x02105 | No | 1.0 | The username is already registered in the network and cannot be used |
| InvalidPeerInput | 8454 | 0x02106 | No | 1.0 | The client provided an invalid peer identification as input |
| InvalidPostText | 8455 | 0x02107 | No | 1.0 | The post contains invalid characters or is too long, see the message for further details |
| InvalidClientPublicHash | 8456 | 0x02108 | No | 1.0 | The client's public hash is invalid and cannot be identified as a sha256 |
| InvalidClientPrivateHash | 8457 | 0x02109 | No | 1.0 | The client's private hash is invalid and cannot be identified as a sha256 |
| InvalidPlatform | 8464 | 0x02110 | No | 1.0 | The platform name contains invalid characters or is too long, see the message for further details |
| InvalidVersion | 8459 | 0x0210b | No | 1.0 | The version is invalid or is too long, see the message for further details |
| InvalidClientName | 8460 | 0x0210c | No | 1.0 | The client name contains invalid characters or is too long, see the message for further details |
| InvalidSessionIdentification | 8461 | 0x0210d | No | 1.0 | The session identification object is invalid, see the message for further details |

View File

@ -0,0 +1,86 @@
/*
* This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
* Copyright (c) 2021 SocialVoid.NET Authors.
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this source code of library.
* If not, see <http://www.gnu.org/licenses/>.
*/
namespace SocialVoid.Errors.ValidationErrors
{
/// <summary>
/// This exception will be raised when the given username is invalid
/// and does not meet the specification.
/// <code> Since: v0.0.0 </code>
/// </summary>
public sealed class UsernameAlreadyExistsException : GeneralException
{
//-------------------------------------------------
#region Constant's Region
// some members here
#endregion
//-------------------------------------------------
#region static Properties Region
// some members here
#endregion
//-------------------------------------------------
#region Properties Region
/// <summary>
/// The <see cref="ErrorCodes.InvalidUsername"/> error code
/// will be returned
/// because the given username is invalid and
/// does not meet the specifications.
/// <code> Since: v0.0.0 </code>
/// </summary>
public override ErrorCodes ErrorCode
{
get
{
return ErrorCodes.InvalidUsername;
}
}
#endregion
//-------------------------------------------------
#region static field's Region
// some members here
#endregion
//-------------------------------------------------
#region field's Region
// some members here
#endregion
//-------------------------------------------------
#region static event field's Region
// some members here
#endregion
//-------------------------------------------------
#region event field's Region
// some members here
#endregion
//-------------------------------------------------
#region Constructor's Region
/// <summary>
/// Creates a new instance of <see cref="UsernameAlreadyExistsException"/>.
/// <code> Since: v0.0.0 </code>
/// </summary>
internal UsernameAlreadyExistsException(string message) : base(message)
{
;
}
#endregion
//-------------------------------------------------
#region Destructor's Region
// some members here
#endregion
//-------------------------------------------------
}
}

View File

@ -1,37 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk">
<!--
This file is part of GUISharp Project (https://github.com/GUISharp/GUISharp).
Copyright (c) 2021 GUISharp Authors.
<!--
This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
Copyright (c) 2021 SocialVoid.NET Authors.
This library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this source code of library.
If not, see <http://www.gnu.org/licenses/>.
This library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this source code of library.
If not, see <http://www.gnu.org/licenses/>.
-->
-->
<!--===================================================-->
<PropertyGroup>
<RuntimeIdentifier Condition="'$(OS)' == 'unix'">linux-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(OS)' == 'Windows_NT'">win-x64</RuntimeIdentifier>
<!--
<RuntimeIdentifier Condition="'$(OS)' == 'unix'">linux-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(OS)' == 'Windows_NT'">win-x64</RuntimeIdentifier>
-->
<AssemblyName>SocialVoid</AssemblyName>
<RootNamespace>SocialVoid</RootNamespace>
<description>The official Socialvoid RPC Library written for C#</description>
<NeutralLanguage>en-US</NeutralLanguage>
<TargetFramework Condition="'$(OS)' == 'Windows_NT'">net5.0;net461;netstandard2.0;netstandard2.1;uap10.0;monoandroid9.0;xamarin.ios10</TargetFramework>
<TargetFramework Condition="'$(OS)' == 'unix'">net5.0</TargetFramework>
<!--
<TargetFramework Condition="'$(OS)' == 'Windows_NT'">net5.0;net461;netstandard2.0;netstandard2.1;uap10.0;monoandroid9.0;xamarin.ios10</TargetFramework>
<TargetFramework Condition="'$(OS)' == 'unix'">net5.0</TargetFramework>
-->
<TargetFramework>net5.0</TargetFramework>
<PackageId>SovialVoid</PackageId>
<Version>0.0.1</Version>
<Authors>SocialVoid Team</Authors>
<PackageProjectUrl>https://github.com/intellivoid/Socialvoid.NET</PackageProjectUrl>
<RepositoryUrl>https://github.com/intellivoid/Socialvoid.NET</RepositoryUrl>
<PackageIconUrl>https://github.com/intellivoid/Socialvoid.NET/raw/master/GUISharp/Icon.ico</PackageIconUrl>
<PackageIconUrl>https://github.com/intellivoid/Socialvoid.NET/raw/master/SocialVoid/Icon.ico</PackageIconUrl>
<PackageIcon>Icon.png</PackageIcon>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
@ -42,7 +48,7 @@
</PropertyGroup>
<!--===================================================-->
<PropertyGroup>
<NoWarn>1591;1701;1702;1705</NoWarn>
<NoWarn>1701;1702;1705</NoWarn>
</PropertyGroup>
<!--===================================================-->
<PropertyGroup>
@ -148,6 +154,7 @@
<!--===================================================-->
</Project>
<!--End of the GUISharp Project File.-->
<!--2019 - 2021 (C) wotoTeam-->
<!--End of the SocialVoid.NET Project File.-->
<!--2021 (C) Intellivoid Inc. -->
<!--2021 (C) SocialVoid Team -->

View File

@ -0,0 +1,52 @@
using System;
using SocialVoid.Errors;
using SocialVoid.Errors.ServerErrors;
using SocialVoid.Errors.NetworkErrors;
using SocialVoid.Errors.ValidationErrors;
using NUnit.Framework;
namespace Tests.Errors
{
[TestFixture]
public class ErrorsTest
{
[TestCase("test1: the given login credentials are incorrect.", 8704)]
[TestCase("test2: the given two-factor authentication code is incorrect.", 8705)]
[TestCase("test3: the user 'aliwoto' does not support this method of authentication", 8706)]
[TestCase("test4: the requested session was not found in the database on server-side.", 8707)]
public void AuthenticationErrorsTest(string message, int errorCode)
{
try
{
CreateException(message, errorCode);
}
catch (GeneralException ex)
{
Log("got exception of type", ex.GetType(), "with error code of", ex.ErrorCode);
if (ex.Message != message || (int)ex.ErrorCode != errorCode)
{
throw;
}
}
}
private void CreateException(string message, int code)
{
throw GeneralException.GetException(message, (ErrorCodes)code);
}
private void Log(params object[] objs)
{
foreach (var obj in objs)
{
Console.Write(obj);
Console.Write(" ");
}
Console.Write("\n");
}
}
}

View File

@ -1,11 +0,0 @@
namespace Tests
{
public class Program
{
public static void Main(string[] args)
{
//SocialVoid.TestClass.Something();
}
}
}

View File

@ -1,8 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- GUISharp Project
Copyright (C) 2019 - 2021 ALiwoto
This file is subject to the terms and conditions defined in
file 'LICENSE', which is part of the source code.-->
<!--
This file is part of SocialVoid.NET Project (https://github.com/Intellivoid/SocialVoid.NET).
Copyright (c) 2021 SocialVoid.NET Authors.
This library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
This library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this source code of library.
If not, see <http://www.gnu.org/licenses/>.
-->
<!--===================================================-->
<PropertyGroup>
<OutputType>WinExe</OutputType>
@ -46,6 +60,11 @@
<!--======================-->
</ItemGroup>
<!--===================================================-->
<ItemGroup>
<PackageReference Include="nunit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
</ItemGroup>
<!--===================================================-->
<ItemGroup>
<!--Include the project folders here.-->