Skip to content

Conversation

@isaacharrisholt
Copy link
Contributor

Fixes #3

@isaacharrisholt
Copy link
Contributor Author

@tsloughter I'd appreciate if you could look over this, given you're more Erlang-y than me

%% so we just catch the error and return an unknown error. I'm not sure
%% what causes these.
lookup(Name, Type, Timeout) when is_binary(Name) ->
try lookup_throws(Name, Type, Timeout) of

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waaa!? Well this is good to know, thanks :)

end.

lookup_throws(Name, Type, Timeout) when is_binary(Name) ->
io:format("Name: ~p~n", [Name]),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
io:format("Name: ~p~n", [Name]),

Think you left this my mistake.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Ok(list.concat([a_records, aaaa_records]))
}

fn format_ip_address(ip: IpAddress) -> String {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you do this in Gleam instead of calling inet:ntoa/1 to avoid going back to an Erlang tuple and external ffi?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly didn't know that function existed, but I like to keep things in Gleam where possible.

@isaacharrisholt isaacharrisholt merged commit 792aab9 into main Dec 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use inet_res:getbyname in place of lookup

3 participants