mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-02 10:07:15 +02:00
* Use separate define constants for exception tolerance stuff. * Improve handling of exceptions during entity creation. The entity in question now gets marked as deleted immediately. * Glorious. * Testing components, tests, wrapper exception type.
54 lines
1.6 KiB
C#
54 lines
1.6 KiB
C#
using System;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Robust.Shared.GameObjects.Components
|
|
{
|
|
#if DEBUG
|
|
// If you wanna use these, add it to some random prototype.
|
|
// I recommend the #1 mug:
|
|
// 1. it doesn't spawn on the map (currently).
|
|
// 2. it's at the top of the entity list (currently).
|
|
// 3. it crashed the game before, it's iconic!
|
|
|
|
/// <summary>
|
|
/// Throws an exception in <see cref="OnAdd" />.
|
|
/// </summary>
|
|
public sealed class DebugExceptionOnAddComponent : Component
|
|
{
|
|
public override string Name => "DebugExceptionOnAdd";
|
|
|
|
public override void OnAdd() => throw new NotSupportedException();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Throws an exception in <see cref="ExposeData" />.
|
|
/// </summary>
|
|
public sealed class DebugExceptionExposeDataComponent : Component
|
|
{
|
|
public override string Name => "DebugExceptionExposeData";
|
|
|
|
public override void ExposeData(ObjectSerializer serializer) => throw new NotSupportedException();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Throws an exception in <see cref="Initialize" />.
|
|
/// </summary>
|
|
public sealed class DebugExceptionInitializeComponent : Component
|
|
{
|
|
public override string Name => "DebugExceptionInitialize";
|
|
|
|
public override void Initialize() => throw new NotSupportedException();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Throws an exception in <see cref="Startup" />.
|
|
/// </summary>
|
|
public sealed class DebugExceptionStartupComponent : Component
|
|
{
|
|
public override string Name => "DebugExceptionStartup";
|
|
|
|
protected override void Startup() => throw new NotSupportedException();
|
|
}
|
|
#endif
|
|
}
|