NX01: Minimal split of fault and zillala sitra reporting code
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 39s
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 39s
This commit is contained in:
parent
35d913d6bb
commit
99bf95a82a
9 changed files with 75 additions and 29 deletions
|
|
@ -50,8 +50,9 @@ public class BabelTest {
|
|||
// ᒢᐩᐩ.ᑊᑉᒻᣔᔆᔆ.ᒻᐤᣔᑊᐣᓫᣗ
|
||||
// ᒢᐩᐩ.ᒃᣔᔆᑊᒼ.ᔆᐪᓫᣖ.ᘁᣔᒻᓑᓫ
|
||||
// ᒢᐩᐩ.ᒡᒢᣔᣗᣖ.ᒼᐤᣗᓫ
|
||||
// ᒢᐩᐩ.ᒡᒢᣔᣗᣖ.ᣘᣔᓑᒻᐪ
|
||||
// ᒢᐩᐩ.ᒡᒢᣔᣗᣖ.ᣘᣔᓑᒻᐪ.ᑊᐣᓑᒼᑊᑉ
|
||||
// ᒢᣘᐧᣟ.ᑊᑉᒻᣔᔆᔆ.ᣘᣔᓑᒻᐪ
|
||||
// ᒢᣘᐧᣟ.ᑊᑉᒻᣔᔆᔆ.ᣘᣔᓑᒻᐪ.ᑊᐣᓑᒼᑊᑉ
|
||||
// ᒢᣘᐧᣟ.ᑊᑉᒻᣔᔆᔆ.ᣘᣔᓑᒻᐪ.ᙆᑊᒻᒻᣔᒻᣔ
|
||||
// ᒢᐩᐩ.ᒡᒢᣔᣗᣖ.ᔿᣔᣕᑊᣘᓫᔆᐪᐤᣗ.ᔆᒼᐤᣖᑊᒼ
|
||||
// ᒢᐩᐩ.ᐪᓫᕽᐪ.ᔆᐪᣗᑊᣕᕐ.ᣔᑊᐣᓑᒻᐪ (jpp 18 bit version of PrimordialOctalOrangeString)
|
||||
// ᒢᐩᐩ.ᐪᓫᕽᐪ.ᔆᐪᣗᑊᣕᕐ.ᓑᣕᣳᒼᐤᒄᓫ
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ import love.distributedrebirth.nx01.redsea.hyper.model.HyperFlower;
|
|||
import love.distributedrebirth.nx01.redsea.hyper.model.HyperFlowerAnther;
|
||||
import love.distributedrebirth.nx01.redsea.hyper.local.HyperLocalFileSystem;
|
||||
import love.distributedrebirth.nx01.warp.fault.BassFaultAnchor;
|
||||
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoGrowlFactory;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX0TheMimeType;
|
||||
|
|
@ -95,7 +96,7 @@ public class Java3Seed extends PrintStream {
|
|||
System.err.println(e.toString());
|
||||
}
|
||||
if (BassFaultAnchor.class.isAssignableFrom(e.getClass())) {
|
||||
System.err.println(BassFaultAnchor.class.cast(e).toStringZilLaLa());
|
||||
System.err.println(ZilLaLaManyfestoGrowlFactory.亞.buildFaultScream(BassFaultAnchor.class.cast(e)));
|
||||
}
|
||||
System.exit(1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,10 +34,10 @@ import java.util.Map;
|
|||
import java.util.Optional;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestGenerator;
|
||||
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestSectionWhitePaper;
|
||||
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoGrowlFactory;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
//import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestGenerator;
|
||||
//import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestSectionWhitePaper;
|
||||
//import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoGrowlFactory;
|
||||
//import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
|
||||
/// Bass fault anchor (which replaces; Exception/RuntimeException)
|
||||
///
|
||||
|
|
@ -78,12 +78,19 @@ abstract public class BassFaultAnchor extends BassFaultAnchorSignalStore {
|
|||
return this;
|
||||
}
|
||||
|
||||
public class FaultSignalWhitePaper {
|
||||
private FaultSignalWhitePaper() {
|
||||
}
|
||||
}
|
||||
|
||||
public final BassFaultAnchor appendOnWhitePaper(String key, String value) {
|
||||
return withSignalTrace(SitraManifestSectionWhitePaper.class, key, value);
|
||||
return withSignalTrace(FaultSignalWhitePaper.class, key, value);
|
||||
//return withSignalTrace(SitraManifestSectionWhitePaper.class, key, value);
|
||||
}
|
||||
|
||||
public final BassFaultAnchor appendOnWhitePaper(Consumer<Map<String, String>> tracer) {
|
||||
return withSignalTrace(SitraManifestSectionWhitePaper.class, tracer);
|
||||
return withSignalTrace(FaultSignalWhitePaper.class, tracer);
|
||||
//return withSignalTrace(SitraManifestSectionWhitePaper.class, tracer);
|
||||
}
|
||||
|
||||
public final StackTraceElement[] getStackTraceWithoutSignals() {
|
||||
|
|
@ -124,18 +131,18 @@ abstract public class BassFaultAnchor extends BassFaultAnchorSignalStore {
|
|||
return result;
|
||||
}
|
||||
|
||||
public final String toStringZilLaLa() {
|
||||
return ZilLaLaManyfestoGrowlFactory.亞.buildFaultScream(toZilLaLaManyfesto(), this);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public final String toStringZilLaLaBase64() {
|
||||
return ZilLaLaManyfestoGrowlFactory.亞.buildFaultScreamBase64(toZilLaLaManyfesto(), this);
|
||||
}
|
||||
|
||||
public final WarpManifestX8 toZilLaLaManyfesto() {
|
||||
return SitraManifestGenerator.亞.buildSignalTraceManifest(this);
|
||||
}
|
||||
// public final String toStringZilLaLa() {
|
||||
// return ZilLaLaManyfestoGrowlFactory.亞.buildFaultScream(toZilLaLaManyfesto(), this);
|
||||
// }
|
||||
//
|
||||
// @Deprecated
|
||||
// public final String toStringZilLaLaBase64() {
|
||||
// return ZilLaLaManyfestoGrowlFactory.亞.buildFaultScreamBase64(toZilLaLaManyfesto(), this);
|
||||
// }
|
||||
//
|
||||
// public final WarpManifestX8 toZilLaLaManyfesto() {
|
||||
// return SitraManifestGenerator.亞.buildSignalTraceManifest(this);
|
||||
// }
|
||||
|
||||
static public StackTraceElement[] cleanStackTrace(Throwable e) {
|
||||
if (e instanceof BassFaultAnchor) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import java.util.Optional;
|
|||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoHeader;
|
||||
//import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoHeader;
|
||||
|
||||
/// Bass fault anchor for storing trace signals.
|
||||
///
|
||||
|
|
@ -44,10 +44,12 @@ abstract public class BassFaultAnchorSignalStore extends RuntimeException {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final LinkedHashMap<Class<?>,Map<String, String>> traceSignals = new LinkedHashMap<>();
|
||||
private final Class<?> sectionChain;
|
||||
|
||||
protected BassFaultAnchorSignalStore(String message, Class<?> signal) {
|
||||
super(message);
|
||||
fetchTraceSignalMap(signal).put(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_CHAIN_MESSAGE, message);
|
||||
sectionChain = signal;
|
||||
//fetchTraceSignalMap(signal).put(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_CHAIN_MESSAGE, message);
|
||||
}
|
||||
|
||||
protected BassFaultAnchorSignalStore(Exception error, Class<?> signal) {
|
||||
|
|
@ -69,7 +71,8 @@ abstract public class BassFaultAnchorSignalStore extends RuntimeException {
|
|||
}
|
||||
}
|
||||
}
|
||||
fetchTraceSignalMap(signal).put(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_CHAIN_ICEBERG, error.getClass().getName());
|
||||
sectionChain = signal;
|
||||
//fetchTraceSignalMap(signal).put(ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_CHAIN_ICEBERG, error.getClass().getName());
|
||||
}
|
||||
|
||||
protected BassFaultAnchorSignalStore(Exception error, Class<?> signal, String key, String value) {
|
||||
|
|
@ -82,6 +85,10 @@ abstract public class BassFaultAnchorSignalStore extends RuntimeException {
|
|||
tracer.accept(fetchTraceSignalMap(signal));
|
||||
}
|
||||
|
||||
public Class<?> getSectionChain() {
|
||||
return sectionChain;
|
||||
}
|
||||
|
||||
public final Set<Class<?>> getTraceSignals() {
|
||||
return traceSignals.keySet();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,12 +64,29 @@ public enum SitraManifestGenerator {
|
|||
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_UUID_WM_THREE, SitraManifestUUIDCrematorium.亞.burnWaterMarkThree().toString());
|
||||
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_UUID_WM_FOUR, SitraManifestUUIDCrematorium.亞.burnWaterMarkFour().toString());
|
||||
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_UUID_DATE, uuidDate);
|
||||
|
||||
// TODO: redo section signal patch logic, used to be in BassFaultAnchorSignalStore, this covers most, but add trace to print it feels bad
|
||||
Class<?> sectionRoot = fault.getSectionChain();
|
||||
String sectionRootMsg = fault.getMessage();
|
||||
Throwable faultRoot = fault.getCause();
|
||||
if (faultRoot != null) {
|
||||
if (faultRoot instanceof BassFaultAnchor signalFault) {
|
||||
sectionRoot = signalFault.getSectionChain();
|
||||
sectionRootMsg = signalFault.getMessage();
|
||||
}
|
||||
Throwable faultRootPrev = faultRoot;
|
||||
while (faultRoot.getCause() != null) {
|
||||
faultRootPrev = faultRoot;
|
||||
faultRoot = faultRoot.getCause();
|
||||
}
|
||||
if (faultRoot instanceof BassFaultAnchor signalFault) {
|
||||
sectionRoot = signalFault.getSectionChain();
|
||||
sectionRootMsg = signalFault.getMessage();
|
||||
fault.withSignalTrace(sectionRoot, ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_CHAIN_ICEBERG, faultRootPrev.getClass().getName()); // redo
|
||||
}
|
||||
}
|
||||
fault.withSignalTrace(sectionRoot, ZilLaLaManyfestoHeader.SIGNAL_FAULT_SECTION_CHAIN_MESSAGE, sectionRootMsg); // redo
|
||||
|
||||
if (faultRoot != null) {
|
||||
manifest.withAttribute(ZilLaLaManyfestoHeader.MAIN_FAULT_ROOT_ICEBERG, faultRoot.getClass().getName());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,8 @@ package love.distributedrebirth.nx01.warp.fault.sitra;
|
|||
///
|
||||
/// @author للَّٰهِilLצسُو
|
||||
/// @version ©Δ∞ 仙上主天
|
||||
public enum SitraManifestSectionWhitePaper {
|
||||
@Deprecated
|
||||
/*public*/ enum SitraManifestSectionWhitePaper {
|
||||
;
|
||||
// An empty enum type is a static jvm safe locked pointer to somewhere.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,11 @@ public enum ZilLaLaManyfestoGrowlFactory {
|
|||
/// Multiple characters seen as a slug to indicate that words are eaten.
|
||||
private static final String VALUE_CUTOFF = "...";
|
||||
|
||||
public String buildFaultScream(BassFaultAnchor fault) {
|
||||
WarpManifestX8 manifest = SitraManifestGenerator.亞.buildSignalTraceManifest(fault);
|
||||
return buildFaultScream(manifest, fault);
|
||||
}
|
||||
|
||||
public String buildFaultScream(WarpManifestX8 manifest, BassFaultAnchor fault) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
buf.append(fault.getClass().getSimpleName());
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ package love.distributedrebirth.nx01.warp.fault;
|
|||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestGenerator;
|
||||
import love.distributedrebirth.nx01.warp.fault.sitra.ZilLaLaManyfestoGrowlFactory;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
|
||||
|
|
@ -101,7 +103,7 @@ public class FaultSignalTraceTest {
|
|||
}
|
||||
Assertions.assertNotNull(error);
|
||||
Assertions.assertNotNull(error.getMessage());
|
||||
String errorText = error.toStringZilLaLa();
|
||||
String errorText = ZilLaLaManyfestoGrowlFactory.亞.buildFaultScream(error);
|
||||
//System.out.println(errorText);
|
||||
//System.out.println(errorText.length()); // 3185, 3433
|
||||
Assertions.assertNotNull(errorText);
|
||||
|
|
@ -119,10 +121,14 @@ public class FaultSignalTraceTest {
|
|||
}
|
||||
Assertions.assertNotNull(error);
|
||||
Assertions.assertNotNull(error.getMessage());
|
||||
WarpManifestX8 manifest = error.toZilLaLaManyfesto();
|
||||
WarpManifestX8 manifest = SitraManifestGenerator.亞.buildSignalTraceManifest(error);
|
||||
String sitraText = WarpManifestorDriver.writeV2String(manifest);
|
||||
//System.out.println(sitraText);
|
||||
System.out.println(sitraText);
|
||||
Assertions.assertNotNull(sitraText);
|
||||
Assertions.assertTrue(sitraText.contains("Name: love.distributedrebirth.nx01.warp.fault.FaultSignalTraceTest$SpaceA"));
|
||||
Assertions.assertTrue(sitraText.contains("Fault-Section-Goal: ROCK summit"));
|
||||
Assertions.assertTrue(sitraText.contains("Fault-Section-Chain-Message: The signal trace root"));
|
||||
Assertions.assertTrue(sitraText.contains("Fault-Section-Chain-Iceberg: java.lang.IllegalArgumentException"));
|
||||
Assertions.assertTrue(sitraText.contains("Manifest"));
|
||||
Assertions.assertTrue(sitraText.contains("SpaceB"));
|
||||
Assertions.assertTrue(sitraText.contains("FoodSection"));
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
|||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import love.distributedrebirth.nx01.warp.fault.BassFaultAnchor;
|
||||
import love.distributedrebirth.nx01.warp.fault.FaultStreamDelegate;
|
||||
import love.distributedrebirth.nx01.warp.fault.sitra.SitraManifestGenerator;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.WarpManifestorDriver;
|
||||
import love.distributedrebirth.nx01.warp.manifestor.manifest.WarpManifestX8;
|
||||
|
||||
|
|
@ -62,7 +63,7 @@ public class ZilLaLaFaultFilter extends HttpFilter {
|
|||
throw error;
|
||||
}
|
||||
BassFaultAnchor fault = wrap(error);
|
||||
WarpManifestX8 report = fault.toZilLaLaManyfesto();
|
||||
WarpManifestX8 report = SitraManifestGenerator.亞.buildSignalTraceManifest(fault);
|
||||
|
||||
// TODO: repack and forward to UI form to inspect AND connect+send into a NOSTR
|
||||
// relay
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue