<commit_before>package usage

import (
	"encoding/json"
	"fmt"
	"github.com/brooklyncentral/brooklyn-cli/models"
	"github.com/brooklyncentral/brooklyn-cli/net"
)

func Application(network *net.Network, application string) string {
	url := fmt.Sprintf("/v1/usage/applications/%s", application)
	body, err := network.SendGetRequest(url)
	if err != nil {
		fmt.Println(err)
	}
	return string(body)
}

func Applications(network *net.Network) string {
	url := fmt.Sprintf("/v1/usage/applications")
	body, err := network.SendGetRequest(url)
	if err != nil {
		fmt.Println(err)
	}
	return string(body)
}

func Machine(network *net.Network, machine string) string {
	url := fmt.Sprintf("/v1/usage/machines/%s", machine)
	body, err := network.SendGetRequest(url)
	if err != nil {
		fmt.Println(err)
	}
	return string(body)
}

func Machines(network *net.Network) string {
	url := fmt.Sprintf("/v1/usage/machines")
	body, err := network.SendGetRequest(url)
	if err != nil {
		fmt.Println(err)
	}
	return string(body)
}<commit_msg>Add error handling for usage commands.<commit_after>package usage

import (
	"encoding/json"
	"fmt"
	"github.com/brooklyncentral/brooklyn-cli/models"
	"github.com/brooklyncentral/brooklyn-cli/net"
)

func Application(network *net.Network, application string) (string, error) {
	url := fmt.Sprintf("/v1/usage/applications/%s", application)
	body, err := network.SendGetRequest(url)
	if err != nil {
		return "", err
	}
	return string(body), nil
}

func Applications(network *net.Network) (string, error) {
	url := fmt.Sprintf("/v1/usage/applications")
	body, err := network.SendGetRequest(url)
	if err != nil {
		return "", err
	}
	return string(body), nil
}

func Machine(network *net.Network, machine string) (string, error) {
	url := fmt.Sprintf("/v1/usage/machines/%s", machine)
	body, err := network.SendGetRequest(url)
	if err != nil {
		return "", err
	}
	return string(body), nil
}

func Machines(network *net.Network) (string, error) {
	url := fmt.Sprintf("/v1/usage/machines")
	body, err := network.SendGetRequest(url)
	if err != nil {
		return "", err
	}
	return string(body), nil
}
{'fraction_non_alphanumeric': 0.15585030791094268, 'fraction_numerical': 0.0037896731406916154, 'mean_word_length': 4.572559366754618, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7416408', 'n_tokens_mistral': 762, 'n_tokens_neox': 734, 'n_words': 163}