Comments (8)
addMissionEventHandler ["ScriptError", {
params ["_errorText", "_sourceFile", "_lineNumber", "_errorPos", "_content", "_stackTraceOutput"];
private _src = _stackTraceOutput # 0;
if ((_src#0 == "x\cba\addons\common\XEH_postInit.sqf") && {(_src#1 == 5)}) then {
private _pfID = (_stackTraceOutput#2#3) get "_handle";
systemChat format ["PFEH %1 has failed and will be removed", _pfID];
diag_log text format ["PFEH %1 has failed and will be removed", _pfID];
[_pfID] call CBA_fnc_removePerFrameHandler;
};
}];
you can add that code and it should catch any failing PFEHs and remove them
but this doesn't belong in CBA because it could break things by removing a PFEH that only fails once
we could use a isNil
wrapper but that has a perf penalty
ultimately the best solution is to not have code that can error
from cba_a3.
Code that breaks stuff should not be endorsed, even by being optional. Everything works as expected as is.
from cba_a3.
Solution can be based on my code here: https://pastebin.com/f7LDJxGv
from cba_a3.
Introduce a perFrameHandler that has a long execution time or gets stuck (e.g., infinite loop).
For example?
from cba_a3.
[{systemChat format ["A: %1", time];}, 0, []] call CBA_fnc_addPerFrameHandler;
[{5 == []}, 0, []] call CBA_fnc_addPerFrameHandler;
[{systemChat format ["C: %1", time];}, 0, []] call CBA_fnc_addPerFrameHandler;
C never runs
from cba_a3.
but this doesn't belong in CBA
maybe add this as optional
from cba_a3.
Could we consider making this code more resilient by optionally adding an isNil check (switch in Addons options?)? This would help in scenarios where it's crucial to avoid crashes and ensure continuity of operation, much like landing a satellite on the moon. A failure in one PFH shouldn’t compromise the entire landing operation (high-stakes, high-reliability scenarios).
from cba_a3.
Related Issues (20)
- can someone help HOT 2
- CBA outdated HOT 4
- [Feature Request]: Add an extra parameter to CBA_fnc_execNextFrame for settable frame delay
- cba
- CBA_fnc_compatibleItems Error HOT 6
- Frame related functions dont work in Eden Editor
- Latest CBA version does not honor white space in the CBA settings Configuration File for Task Force Arrowhead Radio (BETA) HOT 2
- Some CBA Settings fail to import HOT 5
- Old armaholic link HOT 1
- Camera not working in Keyframe animation HOT 2
- Toggling 2D and 3D on optics doesn't consistently work unless you hit both applicable keybinds at once. HOT 5
- Third Person View HOT 1
- Vehicle Parameter in GetIn Extended Eventhandler has wrong value HOT 2
- 3.16.1.231025 Bugs in /settings/fnc_parse.sqf and /common/fnc_addPlayerAction.sqf HOT 2
- Zeus not working. Zeus Game Master and Spawn AI modules, when placed in Eden Editor, don't work in Single Player HOT 1
- Problem when running arma with cba Addon "cba_ jam _spe" requires addon "WW2_spe_core_c_zzz_lastloaded_c" HOT 6
- My friend cannot connect to a server because Arma 3 says CBA is not detected even though it is installed HOT 8
- the addon config not working HOT 3
- Server doesn't read cba_settings.sqf file in userconfig HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cba_a3.