-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modernx silently errors and can't recover #40
Comments
thanks for letting me know. ill investigate that and see if i can cleanly resolve the issue. |
Hi again, circling back to this. I decided to give it a shot myself. I used LUA a bit back in WoW so I figured why not. This seems to have fixed the issue, though I'll continue testing overtime through personal use. Here's the changed function function exec_description(args, result)
local ret = mp.command_native_async({
name = "subprocess",
args = args,
capture_stdout = true,
capture_stderr = true
}, function(res, val, err)
if val and val.stdout then
-- replace actual linebreaks with ASS linebreaks
state.localDescriptionClick = string.gsub(val.stdout .. state.dislikes, '\n', "\\N")
-- check if description exists, if it doesn't get rid of the extra "----------"
local descriptionText = state.localDescriptionClick:match("\\N----------\\N(.-)\\N----------\\N")
if (descriptionText == '' or descriptionText == '\\N') then
state.localDescriptionClick = state.localDescriptionClick:gsub("(.*)\\N----------\\N", "%1")
end
-- segment localDescriptionClick parts with " - "
local beforeLastPattern, afterLastPattern = state.localDescriptionClick:match("(.*)\\N----------\\N(.*)")
beforeLastPattern = beforeLastPattern and beforeLastPattern:sub(1, 120) or ""
afterLastPattern = afterLastPattern or ""
state.videoDescription = beforeLastPattern .. "\\N----------\\N" .. afterLastPattern:gsub("\\N", " / ")
local startPos, endPos = state.videoDescription:find("\\N----------\\N")
if startPos and endPos then
state.videoDescription = string.gsub(state.videoDescription:sub(endPos + 1), "\\N----------\\N", " | ")
state.descriptionLoaded = true
msg.info("WEB: Loaded video description")
end
end
end)
end and a diff for it function exec_description(args, result)
local ret = mp.command_native_async({
name = "subprocess",
args = args,
capture_stdout = true,
capture_stderr = true
}, function(res, val, err)
+ if val and val.stdout then
-- replace actual linebreaks with ASS linebreaks
state.localDescriptionClick = string.gsub(val.stdout .. state.dislikes, '\n', "\\N")
-- check if description exists, if it doesn't get rid of the extra "----------"
local descriptionText = state.localDescriptionClick:match("\\N----------\\N(.-)\\N----------\\N")
if (descriptionText == '' or descriptionText == '\\N') then
state.localDescriptionClick = state.localDescriptionClick:gsub("(.*)\\N----------\\N", "%1")
end
-- segment localDescriptionClick parts with " - "
local beforeLastPattern, afterLastPattern = state.localDescriptionClick:match("(.*)\\N----------\\N(.*)")
+ beforeLastPattern = beforeLastPattern and beforeLastPattern:sub(1, 120) or ""
+ afterLastPattern = afterLastPattern or ""
+
state.videoDescription = beforeLastPattern .. "\\N----------\\N" .. afterLastPattern:gsub("\\N", " / ")
local startPos, endPos = state.videoDescription:find("\\N----------\\N")
+
+ if startPos and endPos then
state.videoDescription = string.gsub(state.videoDescription:sub(endPos + 1), "\\N----------\\N", " | ")
state.descriptionLoaded = true
msg.info("WEB: Loaded video description")
+ end
+ end
end)
end |
Hi! sorry for the late response. |
Stacktrace & Error:
In my case, std-out & std-err has been redirected. Once the error has been thrown, the UI cannot be recovered and a restart is needed.
The fail point looks to be here
Alternate proposal: Silently fail and continue to work.
The text was updated successfully, but these errors were encountered: