Refactor: Improve URL Validation and Error Handling in Client Initialization
Currently, when initializing a client with a custom baseURL, the provided value can be almost any string: ```go // this obviously incorrect url won't cause any error here git, err := gitlab.NewClient("yourtokengoeshere", gitlab.WithBaseURL("git.mydomain.com/api/v4")) if err != nil { log.Fatalf("Failed to create client: %v", err) } ``` The [setBaseURL client method](https://gitlab.com/gitlab-org/api/client-go/-/blob/main/gitlab.go?ref_type=heads#L625) have only minimal validation [here](https://gitlab.com/gitlab-org/api/client-go/-/blob/main/gitlab.go?ref_type=heads#L349), which allows invalid values (e.g., missing or incorrect scheme/protocol, malformed host) to pass through silently. However, these issues occur later during API requests, often resulting in unexpected runtime errors such as _dial tcp_ failures or _unsupported protocol_ scheme messages. These errors can be confusing for users. I believe we need stricter validation in **setBaseURL**: validate at least critical components like scheme (protocol), and host during client initialization. It also would be great to add custom error types (e.g., ErrInvalidBaseURL) that can be used with errors.Is() or errors.As() to allow better error handling in user code. And, it would be useful to improve documentation and examples, provide cases of how users can handle common connection errors gracefully.
issue