Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Do not use Soup.Status.get_phrase #333

Closed
spaetz opened this issue Sep 13, 2021 · 1 comment
Closed

Do not use Soup.Status.get_phrase #333

spaetz opened this issue Sep 13, 2021 · 1 comment

Comments

@spaetz
Copy link

spaetz commented Sep 13, 2021

Hi, Debian fails to build from source
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=993088

../../src/Services/Network.vala:69.19-69.40: error: The name `get_phrase' does not exist in the context of `Soup.Status' (libsoup-2.4)
	    var reason = Soup.Status.get_phrase (code);
	                 ^^^^^^^^^^^^^^^^^^^^^^

I don't know why that code is not available, according to the API docs it should be. However, the docs describe the API as
**"There is no reason for you to ever use this function."** (https://valadoc.org/libsoup-2.4/Soup.Status.get_phrase.html).

Instead "you should just look at the message's reason_phrase". Given that the function network.describe_error() is only used twice, it should be easy to replace it:

  1. var error = network.describe_error (code);

    instead of network.describe_error (code), we can use the msg that is available in that function. and

  2. ecb ((int32) status, describe_error ((int32) status));

same, we also have the message available in that function and can use the "reason_phrase". This brings tootle in line with the recommended API as per the libsoup authors.

@spaetz
Copy link
Author

spaetz commented Sep 13, 2021

Just discovered this is aduplicate of #322 and has been filed as #320

@spaetz spaetz closed this as completed Sep 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant