It will be good to provide better error reporting ( e.g. throwing exception) in case if resource name is invalid or doesn't have WebResourceAttribute entry.
Also documentation for ClientScript.RegisterClientScriptResource or GetWebResourceUrl should highlight that WebResourceAttribute is mandatory