Refactored test file code and fixed error. #52

Merged
mathuin merged 0 commits from fix-motd-test-error into master 2015-10-11 02:23:13 +00:00
mathuin commented 2015-10-11 02:09:10 +00:00 (Migrated from gitlab.com)

The following error occurs when the MOTD test file is unavailable:

Main error: Data/Scripts/UI/StartMenu.lua:159: attempt to index local 'f' (a nil value) appVersion: Unofficial Version 1.07 appBuild: 1
StackTrace: stack traceback:
Data/Scripts/ErrorReporting.lua:28: in function <Data/Scripts/ErrorReporting.lua:20>
[C]: in function '__index'
Data/Scripts/UI/StartMenu.lua:159: in function 'onMOTDTaskFinished'
Data/Scripts/UI/StartMenu.lua:24: in function <Data/Scripts/UI/StartMenu.lua:24>
Error Type: lua

While investigating this error, I noticed two identical sections of code
which retrieved the MOTD test file.

I refactored the code to have only one section of code retrieve the file,
and I checked the error condition from opening the test file. When the
test file is not found, the code returns a null string.

The following error occurs when the MOTD test file is unavailable: Main error: Data/Scripts/UI/StartMenu.lua:159: attempt to index local 'f' (a nil value) appVersion: Unofficial Version 1.07 appBuild: 1 StackTrace: stack traceback: Data/Scripts/ErrorReporting.lua:28: in function <Data/Scripts/ErrorReporting.lua:20> [C]: in function '__index' Data/Scripts/UI/StartMenu.lua:159: in function 'onMOTDTaskFinished' Data/Scripts/UI/StartMenu.lua:24: in function <Data/Scripts/UI/StartMenu.lua:24> Error Type: lua While investigating this error, I noticed two identical sections of code which retrieved the MOTD test file. I refactored the code to have only one section of code retrieve the file, and I checked the error condition from opening the test file. When the test file is not found, the code returns a null string.
mathuin commented 2015-10-11 02:14:59 +00:00 (Migrated from gitlab.com)

Added 1 commit:

  • 8bc1e6c4 - Refactored test file code and fixed error.
Added 1 commit: * 8bc1e6c4 - Refactored test file code and fixed error.
Untrustedlife commented 2015-10-11 02:23:13 +00:00 (Migrated from gitlab.com)

Status changed to merged

Status changed to merged
Untrustedlife commented 2015-10-11 02:23:15 +00:00 (Migrated from gitlab.com)

mentioned in commit 8135502e68

mentioned in commit 8135502e6818076821d8ae6cb6b17c30c4726325
Sign in to join this conversation.
No reviewers
No milestone
No project
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.

Dependencies

No dependencies set.

Reference
ald_productions/spacebase-v2-updated-code!52
No description provided.