fix(libSceAjm): map AJM error codes to message strings #3205

Merged
danzaio merged 4 commits from upstream-pr/3205 into main 2026-11-04 17:33:44 +00:00
danzaio commented 2026-10-11 01:06:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by danzaio on 2026-10-11T01:06:26Z.


AJM error codes had no readable form. The lookup threw instead, so a title mapping an error to a message crashed on the throw, and any caller that lived through it still got a null description.

This maps the codes to their messages and keeps the unknown-code error the other AJM calls use. Red aborts in guest_ajm, green passes 1/1 on Windows (MinGW 15.2).

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4815662631 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3205). Originally posted by [danzaio](https://github.com/danzaio) on 2026-10-11T01:06:26Z. --- AJM error codes had no readable form. The lookup threw instead, so a title mapping an error to a message crashed on the throw, and any caller that lived through it still got a null description. This maps the codes to their messages and keeps the unknown-code error the other AJM calls use. Red aborts in guest_ajm, green passes 1/1 on Windows (MinGW 15.2). AI-assisted: yes.
github-actions[bot] commented 2026-10-11 01:06:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T01:06:35Z.


Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6104040003 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3205#issuecomment-6104040003). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T01:06:35Z. --- Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
oneandonlydean commented 2026-10-17 23:57:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T23:57:52Z.


Thanks for reopening this. It no longer merges cleanly into current main. Could you rebase onto current main? sceAjmStrError still throws NotImplemented on main, so this fix is still wanted. We'll review and run full CI on the new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6243431519 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3205#issuecomment-6243431519). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-17T23:57:52Z. --- Thanks for reopening this. It no longer merges cleanly into current main. Could you rebase onto current main? sceAjmStrError still throws NotImplemented on main, so this fix is still wanted. We'll review and run full CI on the new head.
oneandonlydean commented 2026-10-19 09:52:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-19T09:52:12Z.


@danzaio We reviewed this. The code is correct, and the conflict with main is just two sets of appended tests in GuestAjm.cpp. What holds it is where the strings come from:

  • The five per-code messages are main's own SCE_AJM_ERROR_* constant names in sentence case, and "Unknown AJM error" has no source. #5000 was closed on 13 Oct for the same reason: the real table lives only in firmware libSceAjm, and the bar to reopen was a named title that fails on the current behaviour, or a sourced table.
  • On main, sceAjmStrError throws (NotImplemented); it doesn't return nullptr.

Could you post the title (PPSA id) and the log where it hits that throw? With that we'll take it, merge main in for you and run full CI (guest_ajm). Without it we'll record the stub in the silent-stubs debt list instead. Thanks!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6264468448 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3205#issuecomment-6264468448). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-19T09:52:12Z. --- @danzaio We reviewed this. The code is correct, and the conflict with `main` is just two sets of appended tests in GuestAjm.cpp. What holds it is where the strings come from: - The five per-code messages are `main`'s own `SCE_AJM_ERROR_*` constant names in sentence case, and "Unknown AJM error" has no source. #5000 was closed on 13 Oct for the same reason: the real table lives only in firmware libSceAjm, and the bar to reopen was a named title that fails on the current behaviour, or a sourced table. - On `main`, `sceAjmStrError` throws (NotImplemented); it doesn't return nullptr. Could you post the title (PPSA id) and the log where it hits that throw? With that we'll take it, merge `main` in for you and run full CI (`guest_ajm`). Without it we'll record the stub in the silent-stubs debt list instead. Thanks!
CnRJay commented 2026-11-01 19:52:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:52:28Z.

Review: COMMENTED


The table in core/libs/prx/libSceAjm.native/Export.cpp carries a provenance comment naming PPSA01317 plus a hex code comment on every line. tools/check_conventions.py reports a title ID anywhere under core/ as title-specific, so that line will fail the Conventions check. The provenance is already in the debt entry; could the comments go and the table stay as it is?

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5729932101 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3205#pullrequestreview-5729932101). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-11-01T19:52:28Z. **Review:** COMMENTED --- The table in `core/libs/prx/libSceAjm.native/Export.cpp` carries a provenance comment naming PPSA01317 plus a hex code comment on every line. `tools/check_conventions.py` reports a title ID anywhere under `core/` as title-specific, so that line will fail the Conventions check. The provenance is already in the debt entry; could the comments go and the table stay as it is?
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!3205
No description provided.