Changeset 1776

Show
Ignore:
Timestamp:
16/09/10 09:08:03 (3 years ago)
Author:
matthijs
Message:

luci-music: Give an error message when audio is not running.

Previously, luci show the user a backtrace with no indication as to what
was wrong. Now it shows a proper message (though this should not
normally happen, but just in case).

Closes: #637

Location:
trunk/luci/applications/luci-music/luasrc
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/luci/applications/luci-music/luasrc/controller/music.lua

    r1134 r1776  
    232232        local csocket = require "nixio".connect("127.0.0.1", 15052) 
    233233 
     234        -- If we can't connect to audiod, it's probably not running. 
     235        -- Tell the user instead of throwing a traceback at them. 
     236        if not csocket then 
     237                 tpl.render("music/notrunning") 
     238                 return 
     239        end 
     240 
    234241        -- M3U-Play request? 
    235242        local m3u = http.formvalue("m3u")