             {:ok, %HTTPoison.Response{status_code: 404}} ->
               Logger.error "Not found :("
             {:error, %HTTPoison.Error{reason: reason}} ->
-              Logger.error reason
+              Logger.error inspect(reason)
         end    
       end            
     end 

        case HTTPoison.get(userinfo_url) do
            {:ok, %HTTPoison.Response{status_code: 200, body: body}} ->
              result = Poison.Parser.parse!(body)
              IO.inspect result
              changeset = User.changeset(%User{}, %{"openid"=> result["openid"], "nickname"=> result["nickname"], 
                  "province"=> result["province"],
                   "country"=> result["country"],

        case HTTPoison.get(access_url) do
          {:ok, %HTTPoison.Response{status_code: 200, body: body}} ->
            result = Poison.Parser.parse!(body)
            Logger.info inspect(result)
            conn = put_session(conn, :access_token, result["access_token"])
            conn = put_session(conn, :openid, result["openid"])
          {:ok, %HTTPoison.Response{status_code: 404}} ->
            Logger.error "Not found :("
          {:error, %HTTPoison.Error{reason: reason}} ->
            Logger.error inspect(reason)
        end    

        access_token = get_session(conn, :access_token) 
