defmodule Phoenix.Router.Errors do

  def ensure_valid_path!(path) do
    message = """
    Path must start with slash.
    Change path from:
    #{path}
    to
    /#{path}
    """

    unless String.at(path, 0) == "/" do
      raise(ArgumentError, message: message)
    end
  end

end

defmodule Phoenix.Router.Errors do

  def ensure_valid_path!(<<"/" <> _rest>>), do: nil
  def ensure_valid_path!(path) do
    raise ArgumentError, message: """
    Path must start with slash.
    Change path from:
    #{path}
    to
    /#{path}
    """
  end
end

Use pattern matching for route validity.
Use pattern matching for route validity.

CD1212/phoenix,michalmuskala/phoenix,justnoxx/phoenix,CultivateHQ/phoenix,lancehalvorsen/phoenix,nshafer/phoenix,andrewvy/phoenix,kidaa/phoenix,bsmr-erlang/phoenix,sadiqmmm/phoenix,Kosmas/phoenix,wsmoak/phoenix,vic/phoenix,michalmuskala/phoenix,rodrigues/phoenix,bsmr-erlang/phoenix,jwarwick/phoenix,Fluxuous/phoenix,ericmj/phoenix,y-yagi/phoenix,gjaldon/phoenix,bdtomlin/phoenix,ephe-meral/phoenix,doomspork/phoenix,ericmj/phoenix,maxnordlund/phoenix,bsodmike/phoenix,Kosmas/phoenix,manukall/phoenix,jeffkreeftmeijer/phoenix,optikfluffel/phoenix,stefania11/phoenix,CultivateHQ/phoenix,begleynk/phoenix,evax/phoenix,mitchellhenke/phoenix,rodrigues/phoenix,Joe-noh/phoenix,JHKennedy4/phoenix,Joe-noh/phoenix,trarbr/phoenix,jwarwick/phoenix,daytonn/phoenix,cas27/phoenix,yonglehou/phoenix,nickgartmann/phoenix,marcioj/phoenix,mschae/phoenix,greyhwndz/phoenix,robhurring/phoenix,romul/phoenix,mvidaurre/phoenix,kholbekj/phoenix,FND/phoenix,nicrioux/phoenix,seejee/phoenix,kevinold/phoenix,vic/phoenix,safi/phoenix,keathley/phoenix,Dahoon/phoenix,mitchellhenke/phoenix,DavidAlphaFox/phoenix,mobileoverlord/phoenix,tony612/phoenix,mschae/phoenix,iStefo/phoenix,esbullington/phoenix-1,trarbr/phoenix,thegrubbsian/phoenix,foxnewsnetwork/phoenix,mobileoverlord/phoenix,0x00evil/phoenix,phoenixframework/phoenix,sdnorm/phoenix,optikfluffel/phoenix,hsavit1/phoenix,beni55/phoenix,cas27/phoenix,phoenixframework/phoenix,mvidaurre/phoenix,keathley/phoenix,stevedomin/phoenix,bitgamma/phoenix,DavidAlphaFox/phoenix,phoenixframework/phoenix,0x00evil/phoenix,jxs/phoenix,ephe-meral/phoenix,Eventacular/phoenix,scrogson/phoenix,nshafer/phoenix,pap/phoenix,wicliff/phoenix,omotenko/phoenix_auth,jamilabreu/phoenix,stevedomin/phoenix,evax/phoenix,StevenNunez/phoenix,optikfluffel/phoenix,korobkov/phoenix,yoavlt/phoenix,SmartCasual/phoenix,pap/phoenix,korobkov/phoenix,paulcsmith/phoenix,Gazler/phoenix,javimolla/phoenix,jeffweiss/phoenix,dmarkow/phoenix,VictorZeng/phoenix,omotenko/phoenix_auth,Ben-Evolently/phoenix,KazuCocoa/phoenix,fbjork/phoenix,hotvulcan/phoenix,nshafer/phoenix,milafrerichs/phoenix,switchflip/phoenix,GabrielNicolasAvellaneda/phoenix,lono-devices/phoenix,arthurcolle/phoenix,gjaldon/phoenix,ACPK/phoenix,rafbgarcia/phoenix,ugisozols/phoenix,doron2402/phoenix,iguberman/phoenix,xtity/simple_phoenix,eksperimental/phoenix,0x00evil/phoenix,ahmetabdi/phoenix,lancehalvorsen/phoenix,eksperimental/phoenix,Rumel/phoenix,andrewvy/phoenix,kyledecot/phoenix,Rumel/phoenix,rafbgarcia/phoenix,rafbgarcia/phoenix,jasond-s/phoenix,iStefo/phoenix,seejee/phoenix,robomc/phoenix,linearregression/phoenix,Smulligan85/phoenix,henrik/phoenix,ybur-yug/phoenix,brucify/phoenix,elliotcm/phoenix,wsmoak/phoenix,dmarkow/phoenix,ybur-yug/phoenix,Gazler/phoenix,manukall/phoenix,Smulligan85/phoenix,jamilabreu/phoenix,lono-devices/phoenix